Package overit.geocall.servlet
Class WebResource
java.lang.Object
overit.geocall.servlet.WebResource
- All Implemented Interfaces:
DataSource,Serializable,Cloneable,overit.geocall.clipboard.ClipboardObject,overit.geocall.marks.NameExposer
- Direct Known Subclasses:
S3WebResource
public abstract class WebResource
extends Object
implements overit.geocall.clipboard.ClipboardObject, DataSource, Cloneable
This abstract class defines a web resources as for example a folder
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract WebResourceanotherFile(String name) Creates another fileabstract Objectclone()abstract StringcopyTo(WebResource wr) Copy a fileabstract Datedate()Returns the Dateabstract Stringdelete()Delete a fileprotected static StringencodePart(String s) abstract booleanexists()Returntrueif exist,falseotherwiseabstract booleanCopies the input File in the output Fileabstract StringReturns the base nameabstract WebResourceReturns the containerabstract DBViewReturns aDBViewabstract StringgetDirectDownloadUrl(overit.geocall.servlet.WebResourceUrl wru) returns a direct resource download url or null if not possibleabstract StringgetDirectUploadUrl(overit.geocall.servlet.WebResourceUrl wru) returns a direct resource upload url or null if not possibleabstract WebResourceReturns the folderstatic WebResourceDeprecated.use locateFolder insteadstatic WebResourcegetFolder(Identity id, String fullname, overit.geocall.servlet.WebResourceFactory wrf, boolean create) Deprecated.the identity is not useful, so use directly the correctWebResourceFactory.locateFolder(java.lang.String, boolean)protected static Stringabstract InputStreamstatic overit.geocall.servlet.MimeTypegetMimeType(String name, boolean folder) abstract OutputStreamgetOutputStream(boolean append) Returns the OutputStreamabstract WebResourcegetResource(String resource) Returns a resource with a given namestatic WebResourcegetResource(Identity id, String fullname) Deprecated.use locateResource insteadstatic WebResourcegetResource(Identity identity, String fullname, Long id) Deprecated.use locateResource insteadabstract SourceReturns theSourceabstract booleanisFile()Returntrueif is a file,falseotherwiseabstract booleanisFolder()Returntrueif is a folder,falseotherwiseabstract booleanReturntrueif the folder is empty,falseotherwiseabstract booleanisRoot()Returntrueif is the root,falseotherwiseabstract longlength()Gets the length of the pathstatic WebResourcelocateFolder(String fullname, boolean create) Locate the folder of a WebResourcestatic WebResourcelocateFolder(String fullname, overit.geocall.servlet.WebResourceFactory wrf, boolean create) Deprecated.use directly the correctWebResourceFactory.locateFolder(java.lang.String, boolean)static WebResourcelocateResource(String fullname, Long id) abstract StringRenames a fileabstract StringSaves anUpFileabstract booleanCopies the input File in the output Fileabstract StringtoString()Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface overit.geocall.clipboard.ClipboardObject
onCopy, onCut, onLost, onPasteMethods inherited from interface jakarta.activation.DataSource
getName
-
Field Details
-
DOCUMENTS
- See Also:
-
TMP
- See Also:
-
S
public static final char S
-
-
Constructor Details
-
WebResource
public WebResource()
-
-
Method Details
-
locateFolder
Locate the folder of a WebResource- Parameters:
fullname- String containing the fullname of the foldercreate- Boolean indicating if the folder should be created or not- Returns:
- The WebResource if present, null otherwise
-
locateFolder
@Deprecated public static WebResource locateFolder(String fullname, overit.geocall.servlet.WebResourceFactory wrf, boolean create) Deprecated.use directly the correctWebResourceFactory.locateFolder(java.lang.String, boolean)Locate the folder of a WebResource- Parameters:
fullname- String containing the fullname of the folderwrf- the factory for biulding the web resourcecreate- Boolean indicating if the folder should be created or not- Returns:
- The WebResource if present, null otherwise
-
getFolder
@Deprecated public static WebResource getFolder(Identity id, String fullname, overit.geocall.servlet.WebResourceFactory wrf, boolean create) Deprecated.the identity is not useful, so use directly the correctWebResourceFactory.locateFolder(java.lang.String, boolean)- Parameters:
id- The Identityfullname- String containing the fullname of the folderwrf- the factory for biulding the web resourcecreate- Boolean indicating if the folder should be created or not- Returns:
- The WebResource if present, null otherwise
-
getFolder
Deprecated.use locateFolder instead- Parameters:
id- The Identityfullname- String containing the fullname of the foldercreate- Boolean indicating if the folder should be created or not- Returns:
- The WebResource if present, null otherwise
-
locateResource
- Parameters:
fullname- String containing the fullname of the resourceid- The id of the resource- Returns:
- The WebResource if present, null otherwise
-
getResource
Deprecated.use locateResource instead- Parameters:
identity- The Identityfullname- String containing the fullname of the resourceid- The id of the resource- Returns:
- The WebResource if present, null otherwise
-
getResource
Deprecated.use locateResource instead- Parameters:
id- The Identityfullname- String containing the fullname of the resource- Returns:
- The WebResource if present, null otherwise
-
exists
public abstract boolean exists()Returntrueif exist,falseotherwise- Returns:
trueif exist,falseotherwise
-
isFile
public abstract boolean isFile()Returntrueif is a file,falseotherwise- Returns:
trueif is a file,falseotherwise
-
isFolder
public abstract boolean isFolder()Returntrueif is a folder,falseotherwise- Returns:
trueif is a folder,falseotherwise
-
isFolderEmpty
public abstract boolean isFolderEmpty()Returntrueif the folder is empty,falseotherwise- Returns:
trueif the folder is empty,falseotherwise
-
isRoot
public abstract boolean isRoot()Returntrueif is the root,falseotherwise- Returns:
trueif is the root,falseotherwise
-
getContainer
Returns the container- Returns:
- The container
-
getResource
Returns a resource with a given name- Parameters:
resource- The name of the resource- Returns:
- The WebResource
-
getFolder
Returns the folder- Parameters:
folder- The name of the foldercreate- Boolean indicating if the folder should be created or not- Returns:
- The WebResource
-
anotherFile
Creates another file- Parameters:
name- Name of the file- Returns:
- The WebResource
-
delete
Delete a file- Returns:
- A string indicating why is failing
-
save
Saves anUpFile- Parameters:
rf- TheUpFileto save- Returns:
- A string indicating why is failing
-
renameTo
Renames a file- Parameters:
newname- The new name- Returns:
- A string indicating why is failing
-
copyTo
Copy a file- Parameters:
wr- The WebResource- Returns:
- A string indicating why is failing
-
getDBView
Returns aDBView- Parameters:
s- String containing the regular expression- Returns:
- A string indicating why is failing
-
getBasename
Returns the base name- Returns:
- Returns the base name
-
toString
-
clone
-
getOutputStream
Returns the OutputStream- Parameters:
append- Boolean indicating if append should be enabled or not- Returns:
- The OutpurStream
-
getInputStream
- Specified by:
getInputStreamin interfaceDataSource
-
toFile
Copies the input File in the output File- Parameters:
file- String containing the path of the file- Returns:
trueif the copy was successful,falseotherwise
-
fromFile
Copies the input File in the output File- Parameters:
file- String containing the path of the file- Returns:
trueif the copy was successful,falseotherwise
-
encodePart
-
getIcon
-
getMimeType
-
getContentType
- Specified by:
getContentTypein interfaceDataSource
-
length
public abstract long length()Gets the length of the path- Returns:
- The lenght of the path
-
date
Returns the Date- Returns:
- The Date
-
getOutputStream
- Specified by:
getOutputStreamin interfaceDataSource
-
getSource
Returns theSource- Returns:
- The
Source
-
getDirectDownloadUrl
returns a direct resource download url or null if not possible- Parameters:
wru- the webresource for which the direct download URL is requested- Returns:
- a pre-signed url for downloading the resource if supported by the implementation, or null if not supported
-
getDirectUploadUrl
returns a direct resource upload url or null if not possible- Parameters:
wru- the webresource for which the direct upload URL is requested- Returns:
- a pre-signed url for uploading the resource if supported by the implementation, or null if not supported
-