Package org.javlo.service.syncro
Class SynchroHelper
- java.lang.Object
-
- org.javlo.service.syncro.SynchroHelper
-
public class SynchroHelper extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSynchroHelper.SplitFilestatic classSynchroHelper.SplitFileFilter
-
Field Summary
Fields Modifier and Type Field Description static longBIG_FILE_SIZEstatic longSPLIT_FILE_SIZE
-
Constructor Summary
Constructors Constructor Description SynchroHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<String>asSortedList(Set<String> set)static StringbuildSplitFileName(long pos, long partLength, long parentSize)static StringbuildSplitFolderPath(String path)static StringbuildSplitVersionFolderPath(String path, String checksum)static voiddeletedRemoteCacheFile(ContentContext ctx, String fileName)static StringencodeURLPath(String path)static List<SynchroHelper.SplitFile>getSplitFiles(File versionFolder)static booleanisBigFile(long size)static StringperformSynchro(ContentContext ctx)launch synchronizationstatic voidrebuildSplitted(String baseFolder, String path, String checksum)static booleansplitBigFiles(File baseFolder, Map<String,FileInfo> map)Split files if required.static voidsplitFile(File localFile, File destFolder)
-
-
-
Field Detail
-
BIG_FILE_SIZE
public static final long BIG_FILE_SIZE
- See Also:
- Constant Field Values
-
SPLIT_FILE_SIZE
public static final long SPLIT_FILE_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isBigFile
public static boolean isBigFile(long size)
-
buildSplitVersionFolderPath
public static String buildSplitVersionFolderPath(String path, String checksum)
-
buildSplitFileName
public static String buildSplitFileName(long pos, long partLength, long parentSize)
-
splitBigFiles
public static boolean splitBigFiles(File baseFolder, Map<String,FileInfo> map) throws IOException
Split files if required.- Parameters:
baseFolder-map-- Returns:
trueif something changed- Throws:
IOException
-
splitFile
public static void splitFile(File localFile, File destFolder) throws IOException
- Throws:
IOException
-
rebuildSplitted
public static void rebuildSplitted(String baseFolder, String path, String checksum) throws IOException, SynchroNonFatalException
- Throws:
IOExceptionSynchroNonFatalException
-
getSplitFiles
public static List<SynchroHelper.SplitFile> getSplitFiles(File versionFolder)
-
deletedRemoteCacheFile
public static void deletedRemoteCacheFile(ContentContext ctx, String fileName)
-
performSynchro
public static String performSynchro(ContentContext ctx) throws Exception
launch synchronization- Parameters:
application-staticConfig-globalContext-- Returns:
- id of the thread
- Throws:
Exception
-
-