public final class WebBundle extends Object
Constructor and Description |
---|
WebBundle(String name,
List<File> files,
boolean minimized)
Creates a new bundles of files.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
Copyright © 2016 Allette Systems. All rights reserved.