-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing forbidden characters for onedrive imports (#820)
- Loading branch information
1 parent
e6e126f
commit b5edade
Showing
9 changed files
with
382 additions
and
36 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...in/java/org/datatransferproject/transfer/microsoft/MicrosoftTransmogrificationConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.datatransferproject.transfer.microsoft; | ||
|
||
import org.datatransferproject.types.common.models.TransmogrificationConfig; | ||
|
||
// 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 = "~\"#%&*:<>?/\\{|}."; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...c/main/java/org/datatransferproject/transfer/smugmug/SmugMugTransmogrificationConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.datatransferproject.transfer.smugmug; | ||
|
||
import org.datatransferproject.types.common.models.TransmogrificationConfig; | ||
|
||
// 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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...n/src/main/java/org/datatransferproject/types/common/models/TransmogrificationConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.datatransferproject.types.common.models; | ||
|
||
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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.