Class PlexusIoURLResource

    • Constructor Detail

      • PlexusIoURLResource

        protected PlexusIoURLResource​(@Nonnull
                                      java.lang.String name,
                                      long lastModified,
                                      long size,
                                      boolean isFile,
                                      boolean isDirectory,
                                      boolean isExisting)
    • Method Detail

      • getContents

        @Nonnull
        public java.io.InputStream getContents()
                                        throws java.io.IOException
        Description copied from interface: PlexusIoResource
        Creates an InputStream, which may be used to read the files contents. This is useful, if the file selector comes to a decision based on the files contents. Please note that this InputStream is unbuffered. Clients should wrap this in a BufferedInputStream or attempt reading reasonably large chunks (8K+).
        Throws:
        java.io.IOException
      • getDescriptionForError

        public java.lang.String getDescriptionForError​(java.net.URL url)
      • getURL

        public abstract java.net.URL getURL()
                                     throws java.io.IOException
        Description copied from interface: PlexusIoResource
        Returns an URL, which may be used to reference the resource, if possible.
        Returns:
        An URL referencing the resource, if possible, or null. In the latter case, you are forced to use PlexusIoResource.getContents().
        Throws:
        java.io.IOException