Class FileTypeFactory


  • public class FileTypeFactory
    extends java.lang.Object
    A class to create FileTypes.
    • Method Detail

      • singleton

        public static FileTypeFactory singleton()
        Returns the sole FileTypeFactory (with respect to singleton pattern).
        Returns:
        the singleton FileTypeFactory
      • createInputStreamSourceFileType

        public FileType createInputStreamSourceFileType​(java.io.File url)
                                                 throws java.io.IOException
        Creates an InputStreamSourceFileType of the given file name.
        Parameters:
        url - the URL to the InputStream
        Returns:
        an InputStreamSourceFileType pointing to the given URL.
        Throws:
        java.io.IOException
      • createFileType

        public FileType createFileType​(java.io.File fileName,
                                       boolean readonly)
                                throws java.io.IOException
        Creates an InputStreamSourceFileType of the given file name.
        Parameters:
        fileName - the URL to the InputStream
        readonly - file shall be readonly
        Returns:
        a FileType pointing to the given File.
        Throws:
        java.io.IOException
      • createFileType

        public FileType createFileType​(java.io.File fileName,
                                       boolean readonly,
                                       FileTypeFactory.FileTypeChooser ftc)
                                throws java.io.IOException
        Creates an InputStreamSourceFileType of the given file name.
        Parameters:
        fileName - the URL to the InputStream
        readonly - file shall be readonly
        ftc - a FileTypeChooser used if entry in compressed file is not unique.
        Returns:
        a FileType pointing to the given File.
        Throws:
        java.io.IOException
      • createZipFileType

        protected FileType createZipFileType​(java.io.File fileName,
                                             boolean readonly,
                                             FileTypeFactory.FileTypeChooser ftc)
                                      throws java.io.IOException
        This method either loads a Zipfile and checks it content for a CR file or it creates a new Zipfile by using ZipOutputStream to create a new ZipFile with one entry. Actually this behaviour works only "sometimes"...wuuuha
        Throws:
        java.io.IOException