Class MysqlFileManager

  • All Implemented Interfaces:
    FileManager<Integer>, AutoCloseable

    public class MysqlFileManager
    extends Object
    implements FileManager<Integer>
    This class implements a FileManager that writes response content to a file on the file system and a record in MySQL database pointing to the record and allows retrieving the file using an id or request.
    Author:
    Maksim Tkachenko, Truong Quoc Tuan, Ween Jiann Lee
    • Constructor Detail

      • MysqlFileManager

        public MysqlFileManager​(String url,
                                String table,
                                String username,
                                String password,
                                String storageDir)
        Constructs an instance of MysqlFileManager.
        Parameters:
        url - a JDBC URL to the database
        table - table in the database to use for record storage
        username - username for the database
        password - password for the database
        storageDir - storage directory to use for content storage
      • MysqlFileManager

        public MysqlFileManager​(String url,
                                String table,
                                String username,
                                String password,
                                File storagePath)
        Constructs an instance of MysqlFileManager.
        Parameters:
        url - a JDBC URL to the database
        table - name of table in the database to use for record storage
        username - username for the database
        password - password for the database
        storagePath - storage path to use for content storage