|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.cnes.sitools.resources.order.utils.OrderResourceUtils
public final class OrderResourceUtils
Utils methods for OrderResource
Field Summary | |
---|---|
static java.lang.String |
DIRECTORY_PATTERN
zipFilePattern name |
static java.lang.String |
FILE_LIST_PATTERN
fileListPattern name |
static java.lang.String |
ZIP_FILE_PATTERN
zipFilePattern name 0 = orderName, 1 = timestamp |
Method Summary | |
---|---|
static org.restlet.data.Reference |
addFile(org.restlet.representation.Representation repr,
org.restlet.data.Reference refDest,
org.restlet.data.ClientInfo clientInfo,
org.restlet.Context context)
Create a file from the following Representation at the given urlDest. |
static org.restlet.data.Reference |
copyFile(org.restlet.data.Reference fileUrl,
org.restlet.data.Reference destUrl,
org.restlet.data.ClientInfo clientInfo,
org.restlet.Context context)
Copy a file from fileUrl to destUrl destUrl must
contain the fileName |
static void |
deleteFile(org.restlet.data.Reference refFile,
org.restlet.data.ClientInfo clientInfo,
org.restlet.Context context)
Create a file from the following Representation at the given urlDest. |
static SitoolsApplication |
getApplication(org.restlet.Context context)
Gets the SitoolsApplication from the context corresponding to the TaskUtils.PARENT_APPLICATION variable |
static DataSetApplication |
getDataSetApplication(org.restlet.Context context)
Gets the DatasetApplication from the context corresponding to the TaskUtils.PARENT_APPLICATION variable |
static java.lang.String |
getDataStorageUrl(org.restlet.Context context)
Gets the dataStorageUrl value |
static org.restlet.representation.Representation |
getFile(org.restlet.data.Reference fileUrl,
org.restlet.data.ClientInfo clientInfo,
org.restlet.Context context)
Gets the representation of a File |
static java.lang.String |
getFileName(java.lang.String url)
Get the fileName contained in the given url https://www.google.fr/search? |
static AttributeValue |
getInParam(ResourceParameter param,
Record rec)
Util method to retrieve an AttributeValue from a Record
from a given USER_INPUT ResourceParameter |
static java.lang.String |
getResourceOrderStorageUrl(org.restlet.Context context)
Gets the userStorageUrl value |
static java.lang.String |
getTemporaryStorageUrl(org.restlet.Context context)
Gets the userStorageUrl value |
static org.restlet.data.Reference |
getUserAvailableFolderPath(org.restlet.security.User user,
org.restlet.Context context)
Get an available folder path for a given User If there is a user , the folder will point into the userstorage of this user If not it will point into the tmp directory Folder hierarchy is SVAClassName/SvaTaskId |
static org.restlet.data.Reference |
getUserAvailableFolderPath(org.restlet.security.User user,
java.lang.String folderName,
org.restlet.Context context)
Get an available folder path for a given User and a given folderName If there is a user, the folder will point into the userstorage of this user If not it will point into the tmp directory Folder hierarchy is folderName or SVAClassName/SvaTaskId if
folderName is null |
static java.lang.String |
getUserAvailableFolderUrl(org.restlet.security.User user,
java.lang.String folderName,
org.restlet.Context context)
getUserAvailableFolderUrl |
static java.lang.String |
getUserStorageUrl(java.lang.String userIdentifier,
org.restlet.Context context)
Gets the userStorageUrl value for a given userIdentifier |
static org.restlet.data.Reference |
riapToExternal(org.restlet.data.Reference reference,
SitoolsSettings settings)
Rewrite the given reference to change the host domain |
static void |
tarFiles(java.util.List<org.restlet.data.Reference> listOfFiles,
java.util.Map<org.restlet.data.Reference,java.lang.String> refMap,
java.lang.String destFilePath,
java.lang.String archiveFileName,
org.restlet.data.ClientInfo clientInfo,
org.restlet.Context context,
boolean gzip)
Zip the files listed in listOfFiles into the given destFilePath |
static void |
tarFiles(java.util.List<org.restlet.data.Reference> listOfFiles,
java.lang.String destFilePath,
java.lang.String archiveFileName,
org.restlet.data.ClientInfo clientInfo,
org.restlet.Context context,
boolean gzip)
Zip the files listed in listOfFiles into the given destFilePath |
static void |
zipFiles(java.util.List<org.restlet.data.Reference> listOfFiles,
java.util.Map<org.restlet.data.Reference,java.lang.String> refMap,
java.lang.String destFilePath,
java.lang.String destFileName,
org.restlet.data.ClientInfo clientInfo,
org.restlet.Context context)
Zip the files listed in listOfFiles into the given destFilePath |
static void |
zipFiles(java.util.List<org.restlet.data.Reference> listOfFiles,
java.lang.String destFilePath,
org.restlet.data.ClientInfo clientInfo,
org.restlet.Context context)
Zip the files listed in listOfFiles into the given destFilePath |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ZIP_FILE_PATTERN
public static final java.lang.String DIRECTORY_PATTERN
public static final java.lang.String FILE_LIST_PATTERN
Method Detail |
---|
public static org.restlet.data.Reference addFile(org.restlet.representation.Representation repr, org.restlet.data.Reference refDest, org.restlet.data.ClientInfo clientInfo, org.restlet.Context context) throws SitoolsException
repr
- the representationrefDest
- the destination reference. Must be complete with file name in itclientInfo
- the ClientInfo to check if the user has the rights to add the filecontext
- The context
SitoolsException
- if there is an error while creating the filepublic static org.restlet.data.Reference copyFile(org.restlet.data.Reference fileUrl, org.restlet.data.Reference destUrl, org.restlet.data.ClientInfo clientInfo, org.restlet.Context context) throws SitoolsException
fileUrl
to destUrl
destUrl must
contain the fileName
fileUrl
- the file to copydestUrl
- the destination folder urlclientInfo
- the ClientInfo to check if the user has the rights to copy the
filecontext
- The context
SitoolsException
- if the copy is unsuccessfulpublic static void deleteFile(org.restlet.data.Reference refFile, org.restlet.data.ClientInfo clientInfo, org.restlet.Context context) throws SitoolsException
refFile
- the file referenceclientInfo
- the ClientInfo to check if the user has the rights to delete the
filecontext
- The context
SitoolsException
- if there is an error while deleting the filepublic static org.restlet.data.Reference getUserAvailableFolderPath(org.restlet.security.User user, org.restlet.Context context)
SVAClassName/SvaTaskId
user
- the Usercontext
- The context
public static org.restlet.data.Reference getUserAvailableFolderPath(org.restlet.security.User user, java.lang.String folderName, org.restlet.Context context)
folderName
or SVAClassName/SvaTaskId
if
folderName is null
user
- the UserfolderName
- the name of the foldercontext
- The context
public static java.lang.String getUserAvailableFolderUrl(org.restlet.security.User user, java.lang.String folderName, org.restlet.Context context)
user
- folderName
- context
-
public static org.restlet.representation.Representation getFile(org.restlet.data.Reference fileUrl, org.restlet.data.ClientInfo clientInfo, org.restlet.Context context) throws SitoolsException
fileUrl
- the url of the fileclientInfo
- the ClientInfo to check if the user has the rights to get the filecontext
- The context
SitoolsException
- if there is an error while getting the filepublic static void zipFiles(java.util.List<org.restlet.data.Reference> listOfFiles, java.lang.String destFilePath, org.restlet.data.ClientInfo clientInfo, org.restlet.Context context) throws SitoolsException
listOfFiles
- list of files to zip, must be RIAP or HTTP file urldestFilePath
- the complete file path of the destination zip file, it must
contains the zip file names and must be a local pathclientInfo
- the ClientInfo to check if the user has the rights to zip the filecontext
- The context
SitoolsException
- If something is wrongpublic static void zipFiles(java.util.List<org.restlet.data.Reference> listOfFiles, java.util.Map<org.restlet.data.Reference,java.lang.String> refMap, java.lang.String destFilePath, java.lang.String destFileName, org.restlet.data.ClientInfo clientInfo, org.restlet.Context context) throws SitoolsException
listOfFiles
- list of files to zip, must be RIAP or HTTP file urldestFilePath
- the complete file path of the destination zip file, it must
contains the zip file names and must be a local pathclientInfo
- the ClientInfo to check if the user has the rights to zip the filecontext
- The context
SitoolsException
- If something is wrongpublic static void tarFiles(java.util.List<org.restlet.data.Reference> listOfFiles, java.lang.String destFilePath, java.lang.String archiveFileName, org.restlet.data.ClientInfo clientInfo, org.restlet.Context context, boolean gzip) throws SitoolsException
listOfFiles
- list of files to zip, must be RIAP or HTTP file urldestFilePath
- the complete file path of the destination zip file, it must
contains the zip file names and must be a local pathclientInfo
- the ClientInfo to check if the user has the rights to zip the filecontext
- The context
SitoolsException
- If something is wrongpublic static void tarFiles(java.util.List<org.restlet.data.Reference> listOfFiles, java.util.Map<org.restlet.data.Reference,java.lang.String> refMap, java.lang.String destFilePath, java.lang.String archiveFileName, org.restlet.data.ClientInfo clientInfo, org.restlet.Context context, boolean gzip) throws SitoolsException
listOfFiles
- list of files to zip, must be RIAP or HTTP file urldestFilePath
- the complete file path of the destination zip file, it must
contains the zip file names and must be a local pathclientInfo
- the ClientInfo to check if the user has the rights to zip the filecontext
- The context
SitoolsException
- If something is wrongpublic static java.lang.String getFileName(java.lang.String url)
url
- the url of a file
public static DataSetApplication getDataSetApplication(org.restlet.Context context)
context
- The context
public static SitoolsApplication getApplication(org.restlet.Context context)
context
- The context
public static java.lang.String getUserStorageUrl(java.lang.String userIdentifier, org.restlet.Context context)
userIdentifier
- the userIdentifiercontext
- The context
public static java.lang.String getDataStorageUrl(org.restlet.Context context)
context
- The context
public static java.lang.String getTemporaryStorageUrl(org.restlet.Context context)
context
- The context
public static java.lang.String getResourceOrderStorageUrl(org.restlet.Context context)
context
- The context
public static AttributeValue getInParam(ResourceParameter param, Record rec)
AttributeValue
from a Record
from a given USER_INPUT ResourceParameter
param
- the ResourceParameter
rec
- the Record
AttributeValue
public static org.restlet.data.Reference riapToExternal(org.restlet.data.Reference reference, SitoolsSettings settings)
reference
- the Referencesettings
- TODO
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |