|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.weborganic.bastille.util.WebBundle
public final class WebBundle
A bundle of files to serve.
Nested Class Summary | |
---|---|
static class |
WebBundle.Type
The type of bundling required. |
Constructor Summary | |
---|---|
WebBundle(String name,
List<File> files,
boolean minimized)
Creates a new bundles of files. |
Method Summary | |
---|---|
void |
addImport(File f)
Adds a file to consider as an import. |
void |
clearImport()
Clears the list of imported files. |
List<File> |
files()
Returns the list of files to bundle. |
String |
getETag(boolean refresh)
Returns the etag for that bundle. |
String |
getFileName()
Returns the filename of this bundle. |
String |
id()
Returns an ID for that bundle based on the names list of files. |
static String |
id(List<File> files)
Returns an ID for this bundle. |
boolean |
isCSSMinimizable()
|
boolean |
isFresh()
Calculates whether the bundles is still fresh by comparing the etag. |
boolean |
isMinimized()
Indicates whether the web bundle is minimized. |
String |
name()
Returns the name of this bundle. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebBundle(String name, List<File> files, boolean minimized)
name
- The name of the bundle.files
- The files to bundle.minimized
- Whether the files are minimized.Method Detail |
---|
public String name()
public List<File> files()
public String id()
The ID of the bundle remain constant.
public void clearImport()
public void addImport(File f)
f
- the file to import.public String getETag(boolean refresh)
The etag changes when any of the file changes.
refresh
- true
to calculate the etag; false
otherwise.
public boolean isFresh()
true
if still fresh;
false
otherwise.public boolean isMinimized()
true
if minimized; false
otherwise.public boolean isCSSMinimizable()
true
if it can be safely minimized; false
otherwise.public String getFileName()
The filename is: [name]-[isodate]-[etag-suffix].[extension]
.
Or [name]-[isodate]-[etag-suffix].min.[extension]
if minimized.
public static String id(List<File> files)
files
- the files included in the bundle.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |