Interface FileSystemAdapter


  • public interface FileSystemAdapter
    File adapter interface for connecting to DFS
    Since:
    1.0.0
    Author:
    Pranav Kumar, Dharmesh Khandelwal
    • 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 checked
        fileName - 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 folder
        sourceFileName - The source file
        destinationFolderName - The destination folder
        destinationFileName - 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 id
        fileName - 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 id
        fileName - 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 id
        key - Physical path of the packet which needs to be stored
        document - 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 id
        file - 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 id
        filePath - 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.