Interface FileSystemAdapter
-
public interface FileSystemAdapterFile adapter interface for connecting to DFS- Since:
- 1.0.0
- Author:
- Pranav Kumar, Dharmesh Khandelwal
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancheckFileExistence(String id, String fileName)This method checks whether a file exists in DFS.booleancopyFile(String sourceFolderName, String sourceFileName, String destinationFolderName, String destinationFileName)This method copy document from one folder to anotherbooleandeleteFile(String id, String fileName)This method deletes a particular file related to an ID.booleandeletePacket(String id)This method deletes the packet corresponding to an ID.InputStreamgetFile(String id, String fileName)This method fetches a file corresponding to an ID and returns it.InputStreamgetPacket(String id)This method fetches the packet corresponding to an ID and returns it.booleanisPacketPresent(String id)Checks if is packet present.booleanstoreFile(String id, String key, InputStream document)This method stores the packet corresponding to an IDbooleanstorePacket(String id, File filePath)This method stores the packet corresponding to an enrolment ID.booleanstorePacket(String id, InputStream file)This method stores the packet corresponding to an ID.voidunpackPacket(String id)This method unzips the packet corresponding to an enrolment ID and uploads individual files of that packet.
-
-
-
Method Detail
-
checkFileExistence
boolean checkFileExistence(String id, String fileName)
This method checks whether a file exists in DFS.- Parameters:
id- The ID for which file needs to be checkedfileName- File that needs to checked- Returns:
- True if file is found, false otherwise
-
copyFile
boolean copyFile(String sourceFolderName, String sourceFileName, String destinationFolderName, String destinationFileName)
This method copy document from one folder to another- Parameters:
sourceFolderName- The source foldersourceFileName- The source filedestinationFolderName- The destination folderdestinationFileName- The destination file- Returns:
- True if document copy is successful
-
deleteFile
boolean deleteFile(String id, String fileName)
This method deletes a particular file related to an ID.- Parameters:
id- The idfileName- The file which needs to be deleted- Returns:
- True if the file is successfully deleted
-
deletePacket
boolean deletePacket(String id)
This method deletes the packet corresponding to an ID.- Parameters:
id- The id- Returns:
- True if the packet is deleted successfully
-
getFile
InputStream getFile(String id, String fileName)
This method fetches a file corresponding to an ID and returns it.- Parameters:
id- The idfileName- Required file name- Returns:
- the required file
-
getPacket
InputStream getPacket(String id)
This method fetches the packet corresponding to an ID and returns it.- Parameters:
id- The id- Returns:
- The packet in specified format
-
isPacketPresent
boolean isPacketPresent(String id)
Checks if is packet present.- Parameters:
id- the id- Returns:
- the boolean
-
storeFile
boolean storeFile(String id, String key, InputStream document)
This method stores the packet corresponding to an ID- Parameters:
id- The idkey- Physical path of the packet which needs to be storeddocument- document to be stored- Returns:
- True If the packet is stored successfully
-
storePacket
boolean storePacket(String id, InputStream file)
This method stores the packet corresponding to an ID.- Parameters:
id- The idfile- Packet which needs to be stored- Returns:
- True If the packet is stored successfully
-
storePacket
boolean storePacket(String id, File filePath)
This method stores the packet corresponding to an enrolment ID.- Parameters:
id- The idfilePath- Physical path of the packet which needs to be stored- Returns:
- True If the packet is stored successfully
-
unpackPacket
void unpackPacket(String id) throws IOException
This method unzips the packet corresponding to an enrolment ID and uploads individual files of that packet.- Parameters:
id- The id- Throws:
IOException- Signals that an I/O exception has occurred.
-
-