Class FileLocation

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        FileLocation​(java.io.File file, java.lang.String specification)  
      protected FileLocation​(java.lang.String specification)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the location.
      java.io.File getFile()
      java.io.InputStream getInputStream()
      java.lang.String getSpecification()
      protected void initFile()
      initialize file.
      void open()
      open the location.
      int read​(byte[] buffer)
      int read​(java.nio.ByteBuffer buffer)
      protected void setFile​(java.io.File file)  
      protected java.io.File unsafeGetFile()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileLocation

        public FileLocation​(java.io.File file,
                            java.lang.String specification)
        Parameters:
        file - File
        specification - spec.
      • FileLocation

        protected FileLocation​(java.lang.String specification)
        Parameters:
        specification - spec.
    • Method Detail

      • close

        public void close()
        Close the location.
        Specified by:
        close in interface Location
      • getFile

        public java.io.File getFile()
                             throws java.io.IOException
        Specified by:
        getFile in interface Location
        Returns:
        File.
        Throws:
        java.io.IOException - in case of an error.
      • unsafeGetFile

        protected java.io.File unsafeGetFile()
        Returns:
        File
      • initFile

        protected void initFile()
                         throws java.io.IOException
        initialize file.
        Throws:
        java.io.IOException - in case error.
      • setFile

        protected void setFile​(java.io.File file)
        Parameters:
        file - File
      • getSpecification

        public java.lang.String getSpecification()
        Specified by:
        getSpecification in interface Location
        Returns:
        spec.
      • open

        public void open()
                  throws java.io.IOException
        open the location.
        Specified by:
        open in interface Location
        Throws:
        java.io.IOException - in case of an error.
      • read

        public int read​(java.nio.ByteBuffer buffer)
                 throws java.io.IOException
        Specified by:
        read in interface Location
        Parameters:
        buffer - The buffer.
        Returns:
        number of read bytes.
        Throws:
        java.io.IOException - in case of an error.
      • read

        public int read​(byte[] buffer)
                 throws java.io.IOException
        Specified by:
        read in interface Location
        Parameters:
        buffer - The buffer.
        Returns:
        number of read bytes.
        Throws:
        java.io.IOException - in case of an error.
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Specified by:
        getInputStream in interface Location
        Returns:
        the resulting input stream.
        Throws:
        java.io.IOException - in case of an error.