Class Storage
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Storage
- All Implemented Interfaces:
NewerNewStyleService
,STService
This class provides services for storing content.
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createDirectory
(String dir) Creates a new directoryvoid
createFile
(org.springframework.web.multipart.MultipartFile data, String path, boolean overwrite) Creates a file.void
deleteDirectory
(String dir) Deletes a directoryvoid
deleteFile
(String path) Deletes a filevoid
Downloads a fileLists the entries in a given directoryMethods inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
addValue, checkNotLocallyDefined, createQueryBuilder, generateIRI, generateNatureSPARQLSelectPart, generateNatureSPARQLWherePart, generateResourceWithCustomConstructor, getCodaLexModeForSearchFromLexicalizationModel, getDeleteGraph, getGraphFromNature, getInitializedCodaCore, getManagedConnection, getMetadataGraph, getOptionalProject, getPlatformTransactionManager, getProject, getRepository, getRoleFromNature, getUserNamedGraphs, getWorkingGraph, instantiateSearchStrategy, instantiateSearchStrategy, parseReference, publishResourceDeleted, publishResourceDeleted, removeReifiedValue, retrieveResources, shutDownCodaCore, updateTriplePredicate
-
Constructor Details
-
Storage
public Storage()
-
-
Method Details
-
list
@STServiceOperation @PreAuthorize("@auth.isFileActionAuthorized(#dir, \'R\')") public Collection<DirectoryEntryInfo> list(String dir) Lists the entries in a given directory- Parameters:
dir
- a relative reference to the directory (e.g. sys:/a/b/c.txt)- Returns:
-
createDirectory
@STServiceOperation(method=POST) @PreAuthorize("@auth.isFileActionAuthorized(#dir, \'C\')") public void createDirectory(String dir) Creates a new directory- Parameters:
dir
- a relative reference to the directory (e.g. sys:/a/b/c.txt)
-
deleteDirectory
@STServiceOperation(method=POST) @PreAuthorize("@auth.isFileActionAuthorized(#dir, \'D\')") public void deleteDirectory(String dir) throws IOException Deletes a directory- Parameters:
dir
- a relative reference to the directory (e.g. sys:/a/b/c.txt)- Throws:
IOException
-
createFile
@STServiceOperation(method=POST) @PreAuthorize("@auth.isFileActionAuthorized(#path, \'C\')") public void createFile(org.springframework.web.multipart.MultipartFile data, String path, @Optional boolean overwrite) throws IOException Creates a file. Fails if the file already exists, unlessoverwrite
istrue
- Parameters:
data
- the content of the filepath
- a relative reference to the file (e.g. sys:/a/b/c.txt)overwrite
-- Throws:
IOException
-
deleteFile
@STServiceOperation(method=POST) @PreAuthorize("@auth.isFileActionAuthorized(#path, \'D\')") public void deleteFile(String path) throws IOException Deletes a file- Parameters:
path
- a relative reference to the file (e.g. sys:/a/b/c.txt)- Throws:
IOException
-
getFile
@STServiceOperation @PreAuthorize("@auth.isFileActionAuthorized(#path, \'R\')") public void getFile(jakarta.servlet.http.HttpServletResponse oRes, String path) throws IOException Downloads a file- Parameters:
oRes
- the response object to which the file will be written topath
- a relative reference to the file (e.g. sys:/a/b/c.txt)- Throws:
IOException
-