|
||||||||||
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
public abstract class FileHandler
Contains method to handle files and folders.
This is an absract class that defines the functionality to be implemented by other classes.
Direct known subclasses are:
1) FileHandlerLocalImp to handle requests belonging to the local file system using java.io package.
2) FileHandlerFTPImp to handle requests regarding remote machine using FileTransferProtocol.
Field Summary | |
---|---|
static char |
pathSeparator
Holds the separator used between path elements. |
Constructor Summary | |
---|---|
FileHandler()
|
Method Summary | |
---|---|
abstract boolean |
createFolder(java.lang.String parentFolder,
java.lang.String folderName)
When ovevrridden in a derived class creates a folder at the specified location. |
abstract boolean |
createPath(java.lang.String path)
When overridden in a derived class creates the complete path. |
abstract boolean |
deleteFolder(java.lang.String path,
boolean recursive)
When overridden in a derived class deletes the folder and its subfolders. |
abstract boolean |
downloadFile(java.lang.String sourcePath,
java.lang.String fileName,
java.lang.String destinationPath,
java.lang.String newName)
When overridden in a derived class downloads the file from source to destination. |
abstract boolean |
downloadFiles(java.lang.String source,
java.lang.String extention,
java.lang.String destination)
When overridden in a derived class downloads the files with the given extention from source to destination. |
abstract boolean |
downloadFolder(java.lang.String source,
java.lang.String folderName,
java.lang.String destination,
java.lang.String newName)
When overridden in a derived class downloads a folder from source to destination. |
abstract boolean |
folderExists(java.lang.String folderPath)
When overridden in a derived class determines whether the folder exists or not. |
abstract java.io.File[] |
getFiles(java.lang.String parentFolder)
When overridden in a derived class gets the files within the given folder. |
abstract java.io.File[] |
getFiles(java.lang.String parentFolder,
java.lang.String extention)
When overridden in a derived class gets the files with a specific extention within the given folder. |
abstract int |
getFilesCount(java.lang.String parentFolder)
When overridden in a derived class gets the count of files within the given folder. |
abstract int |
getFilesCount(java.lang.String parentFolder,
java.lang.String extention)
When overridden in a derived class gets the count of files with a specific extention within the given folder. |
abstract int |
getFilesCountRecursively(java.lang.String parentFolder)
When overridden in a derived class gets the count of files within the given folder recursively. |
abstract long |
getFileSize(java.lang.String filePath)
When ovevrridden in a derived class gets the size of the file. |
abstract java.lang.String[] |
getFilesNames(java.lang.String parentFolder)
When overridden in a derived class gets the names of the files within the given folder. |
abstract java.lang.String[] |
getFilesNames(java.lang.String parentFolder,
java.lang.String extention)
When overridden in a derived class gets the names of the files with a specific extention within the given folder. |
abstract java.io.File[] |
getFilesRecursively(java.lang.String parentFolder)
When overridden in a derived class gets the files within the given folder recursively |
abstract long |
getFolderSize(java.lang.String folderPath)
When ovevrridden in a derived class gets the size of the size of the folder recursively. |
abstract java.lang.String[] |
getSubFolders(java.lang.String parentFolder)
When overridden in a derived class gets a list of subfolders within the given folder. |
abstract boolean |
uploadFile(java.lang.String sourcePath,
java.lang.String fileName,
java.lang.String destinationPath,
java.lang.String newName)
When overridden in a derived class uploads the file from source to destination. |
abstract boolean |
uploadFiles(java.lang.String source,
java.lang.String extention,
java.lang.String destination)
When overridden in a derived class uploads the files with the given extention from source to destination. |
abstract boolean |
uploadFolder(java.lang.String source,
java.lang.String folderName,
java.lang.String destination,
java.lang.String newName)
When overridden in a derived class 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 |
---|
public static final char pathSeparator
Constructor Detail |
---|
public FileHandler()
Method Detail |
---|
public abstract boolean createFolder(java.lang.String parentFolder, java.lang.String folderName)
parentFolder
- The parent folder path.folderName
- The name of the folder to create
public abstract long getFileSize(java.lang.String filePath)
filePath
- The complete path of the the file, that is: parent folder + file name + extension.
public abstract long getFolderSize(java.lang.String folderPath)
folderPath
- The complete path of the the folder, that is: parent folder + folder name.
public abstract boolean downloadFolder(java.lang.String source, java.lang.String folderName, java.lang.String destination, java.lang.String newName)
source
- The source parent folder.folderName
- The name of the folder to copy.destination
- The destination parent folder.newName
- The new name of the folder after copying.
public abstract boolean uploadFolder(java.lang.String source, java.lang.String folderName, java.lang.String destination, java.lang.String newName)
source
- The source parent folder.folderName
- The name of the folder to copy.destination
- The destination parent folder.newName
- The new name of the folder after copying.
public abstract boolean downloadFiles(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.;destination
- The destination folder to which the files will be copied.
public abstract boolean downloadFile(java.lang.String sourcePath, java.lang.String fileName, java.lang.String destinationPath, java.lang.String newName)
sourcePath
- The path of the source folder containg the file.fileName
- The name of the file within the source folder to copy.destinationPath
- The path of the destination folder.newName
- The new name of the file at the destination folder.
public abstract boolean uploadFiles(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.;destination
- The destination folder to which the files will be copied.
public abstract boolean uploadFile(java.lang.String sourcePath, java.lang.String fileName, java.lang.String destinationPath, java.lang.String newName)
sourcePath
- The path of the source folder containg the file.fileName
- The name of the file within the source folder to copy.destinationPath
- The path of the destination folder.newName
- The new name of the file at the destination folder.
public abstract boolean deleteFolder(java.lang.String path, boolean recursive)
path
- The path of the folder.recursive
- Whether to delete subfiles and subfolders or not.
public abstract java.lang.String[] getSubFolders(java.lang.String parentFolder)
parentFolder
- The folder to get its subfolders.
public abstract java.io.File[] getFiles(java.lang.String parentFolder)
parentFolder
- The folder to get the files within it.
public abstract java.io.File[] getFilesRecursively(java.lang.String parentFolder)
parentFolder
- The folder to get the files within it.
public abstract java.io.File[] getFiles(java.lang.String parentFolder, java.lang.String extention)
parentFolder
- The folder to get the files within it.extention
- The extention of the files to get.
public abstract java.lang.String[] getFilesNames(java.lang.String parentFolder)
parentFolder
- The folder to get the names of the files within it.
public abstract java.lang.String[] getFilesNames(java.lang.String parentFolder, java.lang.String extention)
parentFolder
- The folder to get the names of the files within it.extention
- The extention of the files to get its name.
public abstract int getFilesCount(java.lang.String parentFolder)
parentFolder
- The folder to get the count of files within it.
public abstract int getFilesCount(java.lang.String parentFolder, java.lang.String extention)
parentFolder
- The folder to get the count of files within it.extention
- The extention of the files to count.
public abstract int getFilesCountRecursively(java.lang.String parentFolder)
parentFolder
- The folder to get the count of files within it.
public abstract boolean folderExists(java.lang.String folderPath)
folderPath
- The folder path.
public abstract boolean createPath(java.lang.String path)
path
- The path to create.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |