java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Storage
All Implemented Interfaces:
NewerNewStyleService, STService

@STService public class Storage extends STServiceAdapter
This class provides services for storing content.
  • 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, unless overwrite is true
      Parameters:
      data - the content of the file
      path - 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 to
      path - a relative reference to the file (e.g. sys:/a/b/c.txt)
      Throws:
      IOException