public class DefaultPortableViewFileServices extends java.lang.Object implements PortableViewFileServices
Default implementation of PortableViewFileServices
Delegates almost all methods in FilenameUtils
Constructor and Description |
---|
DefaultPortableViewFileServices() |
Modifier and Type | Method and Description |
---|---|
java.io.File |
getNewFileName(java.io.File baseFolder,
java.lang.String name) |
java.io.File |
getNewWritableFolder(java.io.File baseFolder,
java.lang.String baseName) |
java.io.File |
getRelativeTo(java.io.File path,
java.io.File basePath) |
java.io.File |
getWritableFolder(java.io.File baseFolder,
java.lang.String baseName) |
boolean |
isReadableFile(java.io.File file) |
boolean |
isReadableFolder(java.io.File folder) |
boolean |
isWritableFolder(java.io.File folder) |
MapContext |
loadMapContext(java.io.File mapContext,
java.io.File relativaPathFolder) |
void |
unzipFile(java.io.File zipFile,
java.io.File outputFloder) |
void |
zipFolder(java.io.File rootFolder,
java.io.File targetFile) |
public void unzipFile(java.io.File zipFile, java.io.File outputFloder) throws java.util.zip.ZipException, java.io.IOException
unzipFile
in interface PortableViewFileServices
outputFloder
- must exists. WARNING: Contents will be removed before
unzipjava.util.zip.ZipException
java.io.IOException
public void zipFolder(java.io.File rootFolder, java.io.File targetFile) throws java.io.IOException
zipFolder
in interface PortableViewFileServices
rootFolder
- rootFolder (must be an existing folder)targetFile
- final file (must not exists)java.io.IOException
public boolean isWritableFolder(java.io.File folder)
isWritableFolder
in interface PortableViewFileServices
public boolean isReadableFolder(java.io.File folder)
isReadableFolder
in interface PortableViewFileServices
public boolean isReadableFile(java.io.File file)
isReadableFile
in interface PortableViewFileServices
public java.io.File getWritableFolder(java.io.File baseFolder, java.lang.String baseName)
getWritableFolder
in interface PortableViewFileServices
baseFolder
- existing and writable folderbaseName
- start of new folderpublic java.io.File getNewWritableFolder(java.io.File baseFolder, java.lang.String baseName)
getNewWritableFolder
in interface PortableViewFileServices
baseFolder
- existing and writable folderbaseName
- start of new folderpublic java.io.File getNewFileName(java.io.File baseFolder, java.lang.String name)
getNewFileName
in interface PortableViewFileServices
baseFolder
- existing and writable foldername
- start of new filepublic java.io.File getRelativeTo(java.io.File path, java.io.File basePath)
getRelativeTo
in interface PortableViewFileServices
FilenameUtils#getRelativeTo(String, String)
public MapContext loadMapContext(java.io.File mapContext, java.io.File relativaPathFolder) throws java.io.IOException, PersistenceException
loadMapContext
in interface PortableViewFileServices
mapContext
- persistence filerelativaPathFolder
- for files refered in mapContextjava.io.IOException
PersistenceException