|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.getdown.data.Resource
public class Resource
Models a single file resource used by an Application.
| Constructor Summary | |
|---|---|
Resource(String path,
URL remote,
File local,
boolean unpack)
Creates a resource with the supplied remote URL and local path. |
|
| Method Summary | |
|---|---|
void |
clearMarker()
Removes any "validated" marker file associated with this resource. |
static String |
computeDigest(File target,
MessageDigest md,
ProgressObserver obs)
Computes the MD5 hash of the supplied file. |
String |
computeDigest(MessageDigest md,
ProgressObserver obs)
Computes the MD5 hash of this resource's underlying file. |
boolean |
equals(Object other)
If our path is equal, we are equal. |
void |
erase()
Wipes this resource file along with any "validated" marker file that may be associated with it. |
File |
getLocal()
Returns the local location of this resource. |
String |
getPath()
Returns the path associated with this resource. |
URL |
getRemote()
Returns the remote location of this resource. |
int |
hashCode()
We hash on our path. |
boolean |
isMarkedValid()
Returns true if this resource has an associated "validated" marker file. |
void |
markAsValid()
Creates a "validated" marker file for this resource to indicate that its MD5 hash has been computed and compared with the value in the digest file. |
boolean |
shouldUnpack()
Returns true if this resource should be unpacked as a part of the validation process. |
String |
toString()
Returns a string representation of this instance. |
boolean |
unpack()
Unpacks this resource file into the directory that contains it. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Resource(String path,
URL remote,
File local,
boolean unpack)
| Method Detail |
|---|
public String getPath()
public File getLocal()
public URL getRemote()
public boolean shouldUnpack()
public String computeDigest(MessageDigest md,
ProgressObserver obs)
throws IOException
IOExceptionpublic boolean isMarkedValid()
public void markAsValid()
throws IOException
IOException - if we fail to create the marker file.public void clearMarker()
public boolean unpack()
public void erase()
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
public static String computeDigest(File target,
MessageDigest md,
ProgressObserver obs)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||