Constructor and Description |
---|
WebsiteFilesResource() |
Modifier and Type | Method and Description |
---|---|
void |
createNewDirectory(String websiteFilesId,
String filePath,
String dirName)
Creates a new dirctory in website.
|
void |
createNewFile(String websiteFilesId,
String filePath,
String fileName)
Creates a new text file in the given website.
|
void |
deleteFile(String websiteFilesId,
String filePath)
Deletes a file in a webiste
|
Response |
downloadZip(String websiteFilesId,
String folderPath)
Download a zipped version of a given directory in the website.
|
Response |
getFile(String websiteFilesId,
String filePath)
Returns the content of a requested file.
|
String |
getFolderChildren(String websiteFilesId,
String folderPath)
returns the children files and folders given a website and root path.
|
protected IFile |
getWebsiteFilesDir(String websiteFilesId)
Returns a file object that represents website files root folder.
|
void |
renameFile(String websiteFilesId,
String filePath,
String newFileName)
Renames a file in the website
|
void |
saveFileText(String websiteFilesId,
String filePath,
String fileContent)
Saves file text to the given website.
|
String |
uploadFile(InputStream uploadedInputStream,
org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail,
String websiteFilesId,
String filePath)
Uploads a file to the given directory.
|
String |
uploadZip(InputStream uploadedInputStream,
org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail,
String websiteFilesId,
String filePath)
Uploads a zip file to the destination website.
|
@Path(value="/getfolderchildren") @GET @Produces(value="text/plain") public String getFolderChildren(@QueryParam(value="websiteFilesId") String websiteFilesId, @QueryParam(value="folderPath") String folderPath) throws PortalException, IOException
websiteFilesId
- the identifier of the WebsiteFilesFolder.folderPath
- the root folder path.PortalException
IOException
@Path(value="/getfile") @GET public Response getFile(@QueryParam(value="websiteFilesId") String websiteFilesId, @QueryParam(value="filePath") String filePath) throws IOException, PortalException
websiteFilesId
- the identifier of the WebsiteFilesFolder.filePath
- the path to the requested file in the website.IOException
PortalException
@Path(value="/savefiletext") @POST public void saveFileText(@FormParam(value="websiteFilesId") String websiteFilesId, @FormParam(value="filePath") String filePath, @FormParam(value="fileContent") String fileContent) throws IOException, PortalException
websiteFilesId
- the identifier of the WebsiteFilesFolder.filePath
- the path to a file in the website.fileContent
- content to be saved to the file.IOException
PortalException
@Path(value="/createnewfile") @POST public void createNewFile(@FormParam(value="websiteFilesId") String websiteFilesId, @FormParam(value="filePath") String filePath, @FormParam(value="fileName") String fileName) throws IOException, PortalException
websiteFilesId
- the identifier of the WebsiteFilesFolder.filePath
- the path to a folder in the website.fileName
- the name of the new text file.IOException
PortalException
@Path(value="/createnewdir") @POST public void createNewDirectory(@FormParam(value="websiteFilesId") String websiteFilesId, @FormParam(value="filePath") String filePath, @FormParam(value="dirName") String dirName) throws IOException, PortalException
websiteFilesId
- the identifier of the WebsiteFilesFolder.filePath
- the path to the parent folder in the website.dirName
- the name of the new directory.IOException
PortalException
@Path(value="/renamefile") @POST public void renameFile(@FormParam(value="websiteFilesId") String websiteFilesId, @FormParam(value="filePath") String filePath, @FormParam(value="newFileName") String newFileName) throws IOException, PortalException
websiteFilesId
- the identifier of the WebsiteFilesFolder.filePath
- the path to a file in the website.newFileName
- the new name of the file.IOException
PortalException
@Path(value="/deletefile") @POST public void deleteFile(@FormParam(value="websiteFilesId") String websiteFilesId, @FormParam(value="filePath") String filePath) throws IOException, PortalException
websiteFilesId
- the identifier of the WebsiteFilesFolder.filePath
- the path to a file in the website to be deleted.IOException
PortalException
@POST @Path(value="/uploadfile") @Consumes(value="multipart/form-data") public String uploadFile(InputStream uploadedInputStream, org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail, String websiteFilesId, String filePath) throws PortalException, IOException
uploadedInputStream
- the file being uploadedfileDetail
- information of the file being uploadedwebsiteFilesId
- the identifier of the WebsiteFilesFolder.filePath
- the path to the file in the website.PortalException
IOException
@POST @Path(value="/uploadzip") @Consumes(value="multipart/form-data") public String uploadZip(InputStream uploadedInputStream, org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail, String websiteFilesId, String filePath) throws PortalException, IOException
uploadedInputStream
- the zip file contentsfileDetail
- information about the zip filewebsiteFilesId
- the identifier of the websitefilePath
- the destination root directory where the zip file should be unzipped.PortalException
IOException
@Path(value="/downloadzip") @GET @Produces(value="application/octet-stream") public Response downloadZip(@QueryParam(value="websiteFilesId") String websiteFilesId, @QueryParam(value="folderPath") String folderPath) throws IOException, PortalException
websiteFilesId
- the identifier of the WebsiteFilesFolder.folderPath
- the folder to be zipped.IOException
PortalException
protected IFile getWebsiteFilesDir(String websiteFilesId) throws PortalException, UnexpectedException
websiteFilesId
- the identifier of the WebsiteFilesFolder.PortalException
UnexpectedException
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.