public abstract class AbstractNut extends Object implements Nut
Base implementation of the Nut interface. A Nut is often represented by a name and a
NutType. This class already manages it.
| Modifier | Constructor and Description |
|---|---|
|
AbstractNut()
Default constructor for serialization purpose.
|
protected |
AbstractNut(Nut o)
Creates a new instance by copying the given
Nut. |
protected |
AbstractNut(String name,
NutType ft,
Future<Long> v)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
String |
getInitialName()
Returns the name of the nut.
|
NutType |
getInitialNutType()
Returns the path type of this nut.
|
String |
getParentFile()
If the file is stored in a directory on the file system, then this method returns the directory.
|
String |
getProxyUri()
Gets the proxy URI.
|
Future<Long> |
getVersionNumber()
Returns an
Long indicating the version of this nut. |
int |
hashCode() |
boolean |
isDynamic()
Indicates if this nut has a dynamic content, meaning that it could be changed each time
Nut.openStream() is
invoked. |
void |
setProxyUri(String uri)
Sets a proxy URI that allow to access the nut through another way.
|
protected void |
setVersionNumber(Future<Long> vn)
Sets internal version number.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitopenStreampublic AbstractNut()
Default constructor for serialization purpose.
protected AbstractNut(Nut o)
Creates a new instance by copying the given Nut.
o - the nut to copypublic String getInitialName()
Returns the name of the nut. This is not a path consequently it should not contains any paths.
getInitialName in interface Nutpublic NutType getInitialNutType()
Returns the path type of this nut.
getInitialNutType in interface Nutpublic String getProxyUri()
Gets the proxy URI.
getProxyUri in interface Nutnull if no proxy URI is setpublic void setProxyUri(String uri)
Sets a proxy URI that allow to access the nut through another way.
setProxyUri in interface Nuturi - the proxy uripublic Future<Long> getVersionNumber()
Returns an Long indicating the version of this nut. This helps to deal with content updates.
getVersionNumber in interface Nutpublic String getParentFile()
If the file is stored in a directory on the file system, then this method returns the directory.
getParentFile in interface Nutnull if the nut is not directly accessible on the file systempublic boolean isDynamic()
Indicates if this nut has a dynamic content, meaning that it could be changed each time Nut.openStream() is
invoked. In this case the nut should not be added to any cache and transformation chain should be applied.
Copyright © 2012-2015. All Rights Reserved.