|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bibalex.daf.handlers.filehandler.FileHandler org.bibalex.daf.handlers.filehandler.FileHandlerLocalImpl
public class FileHandlerLocalImpl
Extends FileHandler to provide local file handling.
Field Summary | |
---|---|
private LocalFileHandler |
handler
A LocalFileHandler to create files and folders. |
Fields inherited from class org.bibalex.daf.handlers.filehandler.FileHandler |
---|
pathSeparator |
Constructor Summary | |
---|---|
FileHandlerLocalImpl()
Creates a new instance of FileHandlerLocalImp. |
Method Summary | |
---|---|
private boolean |
copyFile(java.lang.String sourcePath,
java.lang.String fileName,
java.lang.String destinationPath,
java.lang.String newName)
Copies the file from source to destination. |
private boolean |
copyFiles(java.lang.String source,
java.lang.String extention,
java.lang.String destination)
Copies the files withe given extention from source to destination. |
private boolean |
copyFolder(java.lang.String parentSource,
java.lang.String folderName,
java.lang.String parentDestination,
java.lang.String newName)
Copies a folder from source to destination. |
boolean |
createFolder(java.lang.String parentFolder,
java.lang.String folderName)
Creates the given folder within the specified path. |
boolean |
createPath(java.lang.String path)
Creates the complete path. |
boolean |
deleteFolder(java.lang.String path,
boolean recursive)
Deletes the folder and its subfolders. |
boolean |
downloadFile(java.lang.String sourcePath,
java.lang.String fileName,
java.lang.String destinationPath,
java.lang.String newName)
Downloads the file from source to destination. |
boolean |
downloadFiles(java.lang.String source,
java.lang.String extention,
java.lang.String destination)
Downloads the files with the given extention from source to destination. |
boolean |
downloadFolder(java.lang.String parentSource,
java.lang.String folderName,
java.lang.String parentDestination,
java.lang.String newName)
Downloads a folder from source to destination. |
boolean |
folderExists(java.lang.String folderPath)
Determines whether the given folder exists or not. |
java.io.File[] |
getFiles(java.lang.String parentFolder)
Gets the files within the given folder. |
java.io.File[] |
getFiles(java.lang.String parentFolder,
java.lang.String extention)
Gets the files with a specific extention within the given folder. |
int |
getFilesCount(java.lang.String parentFolder)
Gets the count of files within the given folder. |
int |
getFilesCount(java.lang.String parentFolder,
java.lang.String extention)
Gets the count of files with a specific extention within the given folder. |
int |
getFilesCountRecursively(java.lang.String folderPath)
Gets the total number of files within the folder. Note: The folder is visited recursively. |
long |
getFileSize(java.lang.String filePath)
Gets the size of the file in bytes. |
java.lang.String[] |
getFilesNames(java.lang.String parentFolder)
Gets the names of the files within the given folder. |
java.lang.String[] |
getFilesNames(java.lang.String parentFolder,
java.lang.String extention)
Gets the names of the files with a specific extention within the given folder. |
java.io.File[] |
getFilesRecursively(java.lang.String parentFolder)
Gets the files within the given folder recursively. |
long |
getFolderSize(java.lang.String folderPath)
Gets the size of the folder, recursively, in bytes. |
java.lang.String[] |
getSubFolders(java.lang.String parentFolder)
Gets a list of subfolders within the given folder. |
boolean |
uploadFile(java.lang.String sourcePath,
java.lang.String fileName,
java.lang.String destinationPath,
java.lang.String newName)
Downloads the file from source to destination. |
boolean |
uploadFiles(java.lang.String source,
java.lang.String extention,
java.lang.String destination)
Uploads the files with the given extention from source to destination. |
boolean |
uploadFolder(java.lang.String parentSource,
java.lang.String folderName,
java.lang.String parentDestination,
java.lang.String newName)
Uploads a folder from source to destination. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private LocalFileHandler handler
Constructor Detail |
---|
public FileHandlerLocalImpl()
Method Detail |
---|
public boolean createFolder(java.lang.String parentFolder, java.lang.String folderName)
createFolder
in class FileHandler
parentFolder
- The parnet folder at which the folder will be created.folderName
- the name of the folder.
public boolean downloadFolder(java.lang.String parentSource, java.lang.String folderName, java.lang.String parentDestination, java.lang.String newName)
downloadFolder
in class FileHandler
parentSource
- The source parent folder.folderName
- The name of the folder to copy.parentDestination
- The destination parent folder.newName
- The new name of the folder after copying.
public boolean uploadFolder(java.lang.String parentSource, java.lang.String folderName, java.lang.String parentDestination, java.lang.String newName)
uploadFolder
in class FileHandler
parentSource
- The source parent folder.folderName
- The name of the folder to copy.parentDestination
- The destination parent folder.newName
- The new name of the folder after copying.
private boolean copyFolder(java.lang.String parentSource, java.lang.String folderName, java.lang.String parentDestination, java.lang.String newName)
parentSource
- The source parent folder.folderName
- The name of the folder to copy.parentDestination
- The destination parent folder.newName
- The new name of the folder after copying.
public boolean downloadFiles(java.lang.String source, java.lang.String extention, java.lang.String destination)
downloadFiles
in class FileHandler
source
- The source folder that contain the files.extention
- The extension of the files to be copied.;destination
- The destination folder to which the files will be copied.
public boolean uploadFiles(java.lang.String source, java.lang.String extention, java.lang.String destination)
uploadFiles
in class FileHandler
source
- The source folder that contain the files.extention
- The extension of the files to be copied.;destination
- The destination folder to which the files will be copied.
private boolean copyFiles(java.lang.String source, java.lang.String extention, java.lang.String destination)
source
- The source folder that contain the files.extention
- The extension of the files to be copied. Note use the extension without the dot '.'.destination
- The destination folder to which the files will be copied.
public boolean downloadFile(java.lang.String sourcePath, java.lang.String fileName, java.lang.String destinationPath, java.lang.String newName)
downloadFile
in class FileHandler
sourcePath
- The source folder taht contain the file.fileName
- The name of the file to download.destinationPath
- The destination folder to which the files will be copied.newName
- The new name of the file.
public boolean uploadFile(java.lang.String sourcePath, java.lang.String fileName, java.lang.String destinationPath, java.lang.String newName)
uploadFile
in class FileHandler
sourcePath
- The source folder taht contain the file.fileName
- The name of the file to download.destinationPath
- The destination folder to which the files will be copied.newName
- The new name of the file.
private boolean copyFile(java.lang.String sourcePath, java.lang.String fileName, java.lang.String destinationPath, java.lang.String newName)
sourcePath
- The source path.fileName
- The name of the file.destinationPath
- The destination path.newName
- The new name of the file.
public boolean deleteFolder(java.lang.String path, boolean recursive)
deleteFolder
in class FileHandler
path
- The path of the folder.recursive
- Whether to delete subfiles and subfolders or not. This parameter is not used.
public long getFolderSize(java.lang.String folderPath)
getFolderSize
in class FileHandler
folderPath
- The full path of the folder; that is folder path + folder name.
public long getFileSize(java.lang.String filePath)
getFileSize
in class FileHandler
filePath
- The full path of the file; that is folder path + file name + extension.
public java.lang.String[] getSubFolders(java.lang.String parentFolder)
getSubFolders
in class FileHandler
parentFolder
- The folder to get its subfolders.
public java.io.File[] getFiles(java.lang.String parentFolder)
getFiles
in class FileHandler
parentFolder
- The folder to get the files within it.
public java.io.File[] getFilesRecursively(java.lang.String parentFolder)
getFilesRecursively
in class FileHandler
parentFolder
- The folder to get the files within it.
public java.io.File[] getFiles(java.lang.String parentFolder, java.lang.String extention)
getFiles
in class FileHandler
parentFolder
- The folder to get the files within it.extention
- The extention of the files to get.
public java.lang.String[] getFilesNames(java.lang.String parentFolder)
getFilesNames
in class FileHandler
parentFolder
- The folder to get the names of files within it.
public java.lang.String[] getFilesNames(java.lang.String parentFolder, java.lang.String extention)
getFilesNames
in class FileHandler
parentFolder
- The folder to get the names of the files within it.extention
- The extention of the files to get.
public int getFilesCount(java.lang.String parentFolder)
getFilesCount
in class FileHandler
parentFolder
- The folder to get the count of files within it.
public int getFilesCount(java.lang.String parentFolder, java.lang.String extention)
getFilesCount
in class FileHandler
parentFolder
- The folder to get the count of files within it.extention
- The extention of the files to count.
public int getFilesCountRecursively(java.lang.String folderPath)
getFilesCountRecursively
in class FileHandler
folderPath
- The path of the folder to count its files.
public boolean folderExists(java.lang.String folderPath)
folderExists
in class FileHandler
folderPath
- The path to the folder.
public boolean createPath(java.lang.String path)
createPath
in class FileHandler
path
- The path to create.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |