Interface WebFileBundle
public interface WebFileBundle
-
Method Summary
Modifier and TypeMethodDescriptionCreates a newWebFile
at the given location.Creates a new tag for this entireWebFileBundle
void
Removes theWebFile
at absPathboolean
eUpdates the content of thisWebFile
.
-
Method Details
-
exists
-
get
- Parameters:
absPath
- the absolute path starting with a slash to theWebFile
, relative to thisWebFileBundle
- Returns:
- the
WebFile
head located at the given path. - Throws:
WebFileNotFoundException
- if noWebFile
exists at the given path.
-
create
Creates a newWebFile
at the given location.- Parameters:
absPath
- the absolute path starting with a slash to theWebFile
, relative to thisWebFileBundle
content
- the content of the newWebFile
.- Returns:
- the created
WebFile
. - Throws:
WebFileException
- if another (web) resource already exists at the given location.IllegalArgumentException
- if the given binary isnull
.WebFileException
- in case of insufficient authorization
-
update
WebFile update(String absPath, Binary content) throws WebFileNotFoundException, IllegalArgumentException Updates the content of thisWebFile
.- Parameters:
absPath
- the absolute path starting with a slash to theWebFile
, relative to thisWebFileBundle
content
- the binary data to store.- Returns:
- the updated
WebFile
- Throws:
WebFileNotFoundException
- if noWebFile
exists at the given path.IllegalArgumentException
- if the given binary isnull
.WebFileException
- in case of insufficient authorization
-
delete
Removes theWebFile
at absPath- Parameters:
absPath
- the absolute path starting with a slash to theWebFile
, relative to thisWebFileBundle
- Throws:
WebFileException
- in case the delete did not occur, for example because the resource is not there any more, insufficient authorization, locking, etc
-
getLatestTagName
e- Returns:
- the latest tagName or in case not yet tagged or tagging is not supported, return
null
- Throws:
WebFileException
-
getTagNames
- Returns:
- The immutable
List
ordered list of tag names for thisWebFileBundle
or empty List in case there are no tags for thisWebFileBundle
or tagging is not supported (for thisWebFileBundle
) - Throws:
WebFileException
-
get
WebFile get(String absPath, String tagName) throws WebFileNotFoundException, WebFileTagNotFoundException - Parameters:
absPath
- the absolute path to theWebFile
, starting at theWebFile
s root. The path must start with a slash when notnull
.tagName
- theWebFile
for tagName. WhentagName
is null, the headWebFile
is returned, the same asget(String)
- Returns:
- the
WebFile
tag located at the given path fortagName
. - Throws:
WebFileNotFoundException
- if noWebFile
exists at the given path fortagName
.WebFileTagNotFoundException
-
createTag
Creates a new tag for this entireWebFileBundle
- Returns:
- the name of the newly created tag
- Throws:
WebFileException
-
getAntiCacheValue
String getAntiCacheValue()- Returns:
- the anti-cache value of this
WebFileBundle
, useful to be able to cache resources in the client (browser) : Whenever the client needs new resources, the anti cache value changes resulting in different URLs for the resources. Only chars allowed are [a-z] and [0-9] to avoid encoding/decoding problems when used in URLs
-