public interface Nut
The nut is the fundamental element of WUIC nut. It's represent a nut, generally corresponding to a static (CSS, Javascript, Image). It could be picked thanks to different protocol (FTP, HTTP, cloud, etc).
The name is the path relative to a location specified by a NutDao
which is in charge of nut creations.
Modifier and Type | Method and Description |
---|---|
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. |
boolean |
isDynamic()
Indicates if this nut has a dynamic content, meaning that it could be changed each time
openStream() is
invoked. |
InputStream |
openStream()
Opens and returns an
InputStream pointing to the nut. |
void |
setProxyUri(String uri)
Sets a proxy URI that allow to access the nut through another way.
|
InputStream openStream() throws IOException
Opens and returns an InputStream
pointing to the nut.
IOException
- if an I/O error occursNutType getInitialNutType()
Returns the path type of this nut.
String getInitialName()
Returns the name of the nut. This is not a path consequently it should not contains any paths.
void setProxyUri(String uri)
Sets a proxy URI that allow to access the nut through another way.
uri
- the proxy uriString getProxyUri()
Gets the proxy URI.
null
if no proxy URI is setFuture<Long> getVersionNumber()
Returns an Long
indicating the version of this nut. This helps to deal with content updates.
String getParentFile()
If the file is stored in a directory on the file system, then this method returns the directory.
null
if the nut is not directly accessible on the file systemboolean isDynamic()
Indicates if this nut has a dynamic content, meaning that it could be changed each time openStream()
is
invoked. In this case the nut should not be added to any cache and transformation chain should be applied.
true
if content is dynamic, false
otherwiseCopyright © 2012-2015. All Rights Reserved.