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 class
SynchroHelper.SplitFile
static class
SynchroHelper.SplitFileFilter
-
Field Summary
Fields Modifier and Type Field Description static long
BIG_FILE_SIZE
static long
SPLIT_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 String
buildSplitFileName(long pos, long partLength, long parentSize)
static String
buildSplitFolderPath(String path)
static String
buildSplitVersionFolderPath(String path, String checksum)
static void
deletedRemoteCacheFile(ContentContext ctx, String fileName)
static String
encodeURLPath(String path)
static List<SynchroHelper.SplitFile>
getSplitFiles(File versionFolder)
static boolean
isBigFile(long size)
static String
performSynchro(ContentContext ctx)
launch synchronizationstatic void
rebuildSplitted(String baseFolder, String path, String checksum)
static boolean
splitBigFiles(File baseFolder, Map<String,FileInfo> map)
Split files if required.static void
splitFile(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:
true
if 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:
IOException
SynchroNonFatalException
-
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
-
-