diff --git a/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftTransmogrificationConfig.java b/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftTransmogrificationConfig.java index d29d75e41..1071b1e9f 100644 --- a/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftTransmogrificationConfig.java +++ b/extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftTransmogrificationConfig.java @@ -4,10 +4,23 @@ // This class defines transmogrification paramaters for Microsoft imports public class MicrosoftTransmogrificationConfig extends TransmogrificationConfig { - /** - OneDrive has forbidden characters for file names: - https://support.office.com/en-us/article/invalid-file-names-and-file-types-in-onedrive-onedrive-for-business-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa#invalidcharacters - */ - private final String PHOTO_TITLE_FORBIDDEN_CHARACTERS = "~\"#%&*:<>?/\\{|}."; - private final String ALBUM_NAME_FORBIDDEN_CHARACTERS = "~\"#%&*:<>?/\\{|}."; + /** + OneDrive has forbidden characters for file names: + https://support.office.com/en-us/article/invalid-file-names-and-file-types-in-onedrive-onedrive-for-business-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa#invalidcharacters + */ + private final String PHOTO_TITLE_FORBIDDEN_CHARACTERS = "~\"#%&*:<>?/\\{|}."; + private final String ALBUM_NAME_FORBIDDEN_CHARACTERS = "~\"#%&*:<>?/\\{|}."; + + /** + We need to override the methods + */ + @Override + public String getPhotoTitleForbiddenCharacters() { + return PHOTO_TITLE_FORBIDDEN_CHARACTERS; + } + + @Override + public String getAlbumNameForbiddenCharacters() { + return ALBUM_NAME_FORBIDDEN_CHARACTERS; + } } diff --git a/extensions/data-transfer/portability-data-transfer-smugmug/src/main/java/org/datatransferproject/transfer/smugmug/SmugMugTransmogrificationConfig.java b/extensions/data-transfer/portability-data-transfer-smugmug/src/main/java/org/datatransferproject/transfer/smugmug/SmugMugTransmogrificationConfig.java index bdc634550..03839daf0 100644 --- a/extensions/data-transfer/portability-data-transfer-smugmug/src/main/java/org/datatransferproject/transfer/smugmug/SmugMugTransmogrificationConfig.java +++ b/extensions/data-transfer/portability-data-transfer-smugmug/src/main/java/org/datatransferproject/transfer/smugmug/SmugMugTransmogrificationConfig.java @@ -4,9 +4,22 @@ // This class defines transmogrification paramaters for SmugMug imports public class SmugMugTransmogrificationConfig extends TransmogrificationConfig { - // Smugmug doesn't allow photos to exist outside of a folder - private final boolean ALBUM_ALLOW_ROOT_PHOTOS = false; - // Album size specified here: - // https://github.com/google/data-transfer-project/pull/805/files - private final int ALBUM_MAX_SIZE = 5000; + // Smugmug doesn't allow photos to exist outside of a folder + private final boolean ALBUM_ALLOW_ROOT_PHOTOS = false; + // Album size specified here: + // https://github.com/google/data-transfer-project/pull/805/files + private final int ALBUM_MAX_SIZE = 5000; + + /** + We need to override the methods + */ + @Override + public boolean getAlbumAllowRootPhotos() { + return ALBUM_ALLOW_ROOT_PHOTOS; + } + + @Override + public int getAlbumMaxSize() { + return ALBUM_MAX_SIZE; + } } diff --git a/portability-types-common/src/main/java/org/datatransferproject/types/common/models/TransmogrificationConfig.java b/portability-types-common/src/main/java/org/datatransferproject/types/common/models/TransmogrificationConfig.java index ed30fb629..8d493597c 100644 --- a/portability-types-common/src/main/java/org/datatransferproject/types/common/models/TransmogrificationConfig.java +++ b/portability-types-common/src/main/java/org/datatransferproject/types/common/models/TransmogrificationConfig.java @@ -1,46 +1,49 @@ package org.datatransferproject.types.common.models; +/** + This class is meant to be extended with custom logic for each service. + These defaults represent no-chnage transmogrifications. +*/ public class TransmogrificationConfig { - private final String PHOTO_TITLE_FORBIDDEN_CHARACTERS = ""; - private final char PHOTO_TITLE_REPLACEMENT_CHARACTER = '_'; - private final int PHOTO_TITLE_MAX_LENGTH = -1; - - private final String ALBUM_NAME_FORBIDDEN_CHARACTERS = ""; - private final char ALBUM_NAME_REPLACEMENT_CHARACTER = '_'; - private final int ALBUM_NAME_MAX_LENGTH = -1; - private final boolean ALBUM_ALLOW_ROOT_PHOTOS = true; - private final int ALBUM_MAX_SIZE = -1; - - public String getPhotoTitleForbiddenCharacters() { - return PHOTO_TITLE_FORBIDDEN_CHARACTERS; - } - - public char getPhotoTitleReplacementCharater() { - return PHOTO_TITLE_REPLACEMENT_CHARACTER; - } - - public int getPhotoTitleMaxLength() { - return PHOTO_TITLE_MAX_LENGTH; - } - - public String getAlbumNameForbiddenCharacters() { - return ALBUM_NAME_FORBIDDEN_CHARACTERS; - } - - public char getAlbumNameReplacementCharacter() { - return ALBUM_NAME_REPLACEMENT_CHARACTER; - } - - public int getAlbumNameMaxLength() { - return ALBUM_NAME_MAX_LENGTH; - } - - public boolean getAlbumAllowRootPhotos() { - return ALBUM_ALLOW_ROOT_PHOTOS; - } - - public int getAlbumMaxSize() { - return ALBUM_MAX_SIZE; - } - -} \ No newline at end of file + private final String PHOTO_TITLE_FORBIDDEN_CHARACTERS = ""; + private final char PHOTO_TITLE_REPLACEMENT_CHARACTER = '_'; + private final int PHOTO_TITLE_MAX_LENGTH = -1; + + private final String ALBUM_NAME_FORBIDDEN_CHARACTERS = ""; + private final char ALBUM_NAME_REPLACEMENT_CHARACTER = '_'; + private final int ALBUM_NAME_MAX_LENGTH = -1; + private final boolean ALBUM_ALLOW_ROOT_PHOTOS = true; + private final int ALBUM_MAX_SIZE = -1; + + public String getPhotoTitleForbiddenCharacters() { + return PHOTO_TITLE_FORBIDDEN_CHARACTERS; + } + + public char getPhotoTitleReplacementCharater() { + return PHOTO_TITLE_REPLACEMENT_CHARACTER; + } + + public int getPhotoTitleMaxLength() { + return PHOTO_TITLE_MAX_LENGTH; + } + + public String getAlbumNameForbiddenCharacters() { + return ALBUM_NAME_FORBIDDEN_CHARACTERS; + } + + public char getAlbumNameReplacementCharacter() { + return ALBUM_NAME_REPLACEMENT_CHARACTER; + } + + public int getAlbumNameMaxLength() { + return ALBUM_NAME_MAX_LENGTH; + } + + public boolean getAlbumAllowRootPhotos() { + return ALBUM_ALLOW_ROOT_PHOTOS; + } + + public int getAlbumMaxSize() { + return ALBUM_MAX_SIZE; + } +}