Class CPFile

  • All Implemented Interfaces:
    StorageFile

    class CPFile
    extends InputStreamFile<CPStorageFactory>
    This class provides a class path based implementation of the StorageFile interface. It is used by the database engine to access persistent data and transaction logs under the classpath subsubprotocol.
    • Constructor Detail

      • CPFile

        CPFile​(CPStorageFactory storageFactory,
               java.lang.String parent,
               java.lang.String name)
      • CPFile

        CPFile​(CPFile dir,
               java.lang.String name)
      • CPFile

        private CPFile​(CPStorageFactory storageFactory,
                       java.lang.String child,
                       int pathLen)
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.FileNotFoundException
        Creates an input stream from a file name.
        Specified by:
        getInputStream in interface StorageFile
        Specified by:
        getInputStream in class InputStreamFile<CPStorageFactory>
        Returns:
        an input stream suitable for reading from the file.
        Throws:
        java.io.FileNotFoundException - if the file is not found.
      • getURL

        private java.net.URL getURL()
        Return a URL for this file (resource).
      • getContextClassLoader

        private static java.lang.ClassLoader getContextClassLoader​(java.lang.Thread thread)
        Privileged wrapper for Thread.getContextClassLoader().
      • getResource

        private static java.net.URL getResource​(java.lang.ClassLoader cl,
                                                java.lang.String name)
        Privileged wrapper for ClassLoader.getResource(String).
      • getSystemResource

        private static java.net.URL getSystemResource​(java.lang.String name)
        Privileged wrapper for ClassLoader.getSystemResource(String).
      • getResourceAsStream

        private static java.io.InputStream getResourceAsStream​(java.lang.ClassLoader cl,
                                                               java.lang.String name)
        Privileged wrapper for ClassLoader.getResourceAsStream(String).
      • getSystemResourceAsStream

        private static java.io.InputStream getSystemResourceAsStream​(java.lang.String name)
        Privileged wrapper for ClassLoader.getSystemResourceAsStream(String).