Package org.ringojs.repository
Class ZipResource
- java.lang.Object
-
- org.ringojs.repository.AbstractResource
-
- org.ringojs.repository.ZipResource
-
public final class ZipResource extends AbstractResource
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.ringojs.repository.AbstractResource
baseName, name, path, repository
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ZipResource(java.lang.String childName, ZipRepository repository, java.util.zip.ZipEntry entry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
boolean
exists()
Checks wether this resource actually (still) existslong
getChecksum()
Checksum of the resource content.java.io.InputStream
getInputStream()
Returns an input stream to the content of the resourcelong
getLength()
Returns the length of the resource's contentjava.net.URL
getUrl()
Returns an url to the resource if the repository of this resource is able to provide urls.int
hashCode()
long
lastModified()
Returns the date the resource was last modifiedjava.lang.String
toString()
-
Methods inherited from class org.ringojs.repository.AbstractResource
getBaseName, getContent, getContent, getLineNumber, getModuleName, getName, getParentRepository, getPath, getReader, getReader, getRelativePath, getRootRepository, getStripShebang, isAbsolute, setAbsolute, setBaseNameFromName, setStripShebang, stripShebang
-
-
-
-
Constructor Detail
-
ZipResource
protected ZipResource(java.lang.String childName, ZipRepository repository, java.util.zip.ZipEntry entry)
-
-
Method Detail
-
lastModified
public long lastModified()
Description copied from interface:Trackable
Returns the date the resource was last modified- Returns:
- last modified date
-
getChecksum
public long getChecksum()
Description copied from interface:Trackable
Checksum of the resource content. Implementations should make sure to return a different checksum if the resource's content has changed.- Specified by:
getChecksum
in interfaceTrackable
- Overrides:
getChecksum
in classAbstractResource
- Returns:
- checksum
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Description copied from interface:Resource
Returns an input stream to the content of the resource- Returns:
- content input stream
- Throws:
java.io.IOException
- if a I/O related error occurs
-
exists
public boolean exists() throws java.io.IOException
Description copied from interface:Trackable
Checks wether this resource actually (still) exists- Returns:
- true if the resource exists
- Throws:
java.io.IOException
-
getUrl
public java.net.URL getUrl() throws java.net.MalformedURLException
Description copied from interface:Trackable
Returns an url to the resource if the repository of this resource is able to provide urls.- Returns:
- url to the resource
- Throws:
java.net.MalformedURLException
-
getLength
public long getLength()
Description copied from interface:Resource
Returns the length of the resource's content- Returns:
- content length
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-