Class PlexusIoURLResource
- java.lang.Object
-
- org.codehaus.plexus.components.io.resources.AbstractPlexusIoResource
-
- org.codehaus.plexus.components.io.resources.PlexusIoURLResource
-
- All Implemented Interfaces:
FileInfo,ContentSupplier,NameSupplier,SizeSupplier,PlexusIoResource
public abstract class PlexusIoURLResource extends AbstractPlexusIoResource
-
-
Field Summary
-
Fields inherited from interface org.codehaus.plexus.components.io.resources.PlexusIoResource
UNKNOWN_MODIFICATION_DATE, UNKNOWN_RESOURCE_SIZE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlexusIoURLResource(java.lang.String name, long lastModified, long size, boolean isFile, boolean isDirectory, boolean isExisting)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetContents()Creates anInputStream, which may be used to read the files contents.java.lang.StringgetDescriptionForError(java.net.URL url)abstract java.net.URLgetURL()Returns anURL, which may be used to reference the resource, if possible.-
Methods inherited from class org.codehaus.plexus.components.io.resources.AbstractPlexusIoResource
getLastModified, getName, getSize, isDirectory, isExisting, isFile, isSymbolicLink
-
-
-
-
Method Detail
-
getContents
@Nonnull public java.io.InputStream getContents() throws java.io.IOExceptionDescription copied from interface:PlexusIoResourceCreates anInputStream, 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.IOExceptionDescription copied from interface:PlexusIoResourceReturns anURL, 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
-
-