Interface WebFileBundle
-
public interface WebFileBundle
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebFile
create(String absPath, Binary content)
Creates a newWebFile
at the given location.String
createTag()
Creates a new tag for this entireWebFileBundle
void
delete(String absPath)
Removes theWebFile
at absPathboolean
exists(String absPath)
WebFile
get(String absPath)
WebFile
get(String absPath, String tagName)
String
getAntiCacheValue()
String
getLatestTagName()
eList<String>
getTagNames()
WebFile
update(String absPath, Binary content)
Updates the content of thisWebFile
.
-
-
-
Method Detail
-
exists
boolean exists(String absPath)
-
get
WebFile get(String absPath) throws WebFileNotFoundException
- 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
WebFile create(String absPath, Binary content) throws WebFileException, IllegalArgumentException
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
void delete(String absPath) throws WebFileException
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
String getLatestTagName() throws WebFileException
e- Returns:
- the latest tagName or in case not yet tagged or tagging is not supported, return
null
- Throws:
WebFileException
-
getTagNames
List<String> getTagNames() throws WebFileException
- 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
String createTag() throws WebFileException
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
-
-