Class S3WebResource

java.lang.Object
overit.geocall.servlet.WebResource
overit.geocall.aws.servlet.wr.S3WebResource
All Implemented Interfaces:
DataSource, Serializable, Cloneable, overit.geocall.clipboard.ClipboardObject, overit.geocall.marks.NameExposer

public class S3WebResource extends WebResource
Implementation of a web resource managed by the AWS S3's service.
See Also:
  • Field Details

  • Constructor Details

    • S3WebResource

      public S3WebResource(S3WebResourceFactory factory, String path)
      Create a new reference of a hypothetical web resource identified by the passed path.
      Parameters:
      factory - the reference of the factory object
      path - the full path of the resource
  • Method Details

    • exists

      public boolean exists()
      Description copied from class: WebResource
      Return true if exist, false otherwise
      Specified by:
      exists in class WebResource
      Returns:
      true if exist, false otherwise
    • isFile

      public boolean isFile()
      Description copied from class: WebResource
      Return true if is a file, false otherwise
      Specified by:
      isFile in class WebResource
      Returns:
      true if is a file, false otherwise
    • isFolder

      public boolean isFolder()
      Description copied from class: WebResource
      Return true if is a folder, false otherwise
      Specified by:
      isFolder in class WebResource
      Returns:
      true if is a folder, false otherwise
    • isFolderEmpty

      public boolean isFolderEmpty()
      Description copied from class: WebResource
      Return true if the folder is empty, false otherwise
      Specified by:
      isFolderEmpty in class WebResource
      Returns:
      true if the folder is empty, false otherwise
    • isRoot

      public boolean isRoot()
      Description copied from class: WebResource
      Return true if is the root, false otherwise
      Specified by:
      isRoot in class WebResource
      Returns:
      true if is the root, false otherwise
    • getContainer

      public S3WebResource getContainer()
      Description copied from class: WebResource
      Returns the container
      Specified by:
      getContainer in class WebResource
      Returns:
      The container
    • getResource

      public S3WebResource getResource(String resource)
      Description copied from class: WebResource
      Returns a resource with a given name
      Specified by:
      getResource in class WebResource
      Parameters:
      resource - The name of the resource
      Returns:
      The WebResource
    • getFolder

      public S3WebResource getFolder(String folder, boolean create)
      Description copied from class: WebResource
      Returns the folder
      Specified by:
      getFolder in class WebResource
      Parameters:
      folder - The name of the folder
      create - Boolean indicating if the folder should be created or not
      Returns:
      The WebResource
    • anotherFile

      public S3WebResource anotherFile(String name)
      Description copied from class: WebResource
      Creates another file
      Specified by:
      anotherFile in class WebResource
      Parameters:
      name - Name of the file
      Returns:
      The WebResource
    • delete

      public String delete()
      Description copied from class: WebResource
      Delete a file
      Specified by:
      delete in class WebResource
      Returns:
      A string indicating why is failing
    • save

      public String save(UpFile uf)
      Description copied from class: WebResource
      Saves an UpFile
      Specified by:
      save in class WebResource
      Parameters:
      uf - The UpFile to save
      Returns:
      A string indicating why is failing
    • renameTo

      public String renameTo(String newName)
      Description copied from class: WebResource
      Renames a file
      Specified by:
      renameTo in class WebResource
      Parameters:
      newName - The new name
      Returns:
      A string indicating why is failing
    • copyTo

      public String copyTo(WebResource wr)
      Description copied from class: WebResource
      Copy a file
      Specified by:
      copyTo in class WebResource
      Parameters:
      wr - The WebResource
      Returns:
      A string indicating why is failing
    • getDBView

      public DBView getDBView(String s)
      Description copied from class: WebResource
      Returns a DBView
      Specified by:
      getDBView in class WebResource
      Parameters:
      s - String containing the regular expression
      Returns:
      A string indicating why is failing
    • addToDBView

      protected void addToDBView(software.amazon.awssdk.services.s3.model.S3Object o, DBView dbv, Matcher m, int cols)
    • getBasename

      public String getBasename()
      Description copied from class: WebResource
      Returns the base name
      Specified by:
      getBasename in class WebResource
      Returns:
      Returns the base name
    • toString

      public String toString()
      Specified by:
      toString in class WebResource
    • clone

      public Object clone()
      Specified by:
      clone in class WebResource
    • getOutputStream

      public OutputStream getOutputStream(boolean append)
      Description copied from class: WebResource
      Returns the OutputStream
      Specified by:
      getOutputStream in class WebResource
      Parameters:
      append - Boolean indicating if append should be enabled or not
      Returns:
      The OutpurStream
    • getInputStream

      public InputStream getInputStream()
      Specified by:
      getInputStream in interface DataSource
      Specified by:
      getInputStream in class WebResource
    • toFile

      public boolean toFile(String file)
      Description copied from class: WebResource
      Copies the input File in the output File
      Specified by:
      toFile in class WebResource
      Parameters:
      file - String containing the path of the file
      Returns:
      true if the copy was successful, false otherwise
    • fromFile

      public boolean fromFile(String file)
      Description copied from class: WebResource
      Copies the input File in the output File
      Specified by:
      fromFile in class WebResource
      Parameters:
      file - String containing the path of the file
      Returns:
      true if the copy was successful, false otherwise
    • length

      public long length()
      Description copied from class: WebResource
      Gets the length of the path
      Specified by:
      length in class WebResource
      Returns:
      The lenght of the path
    • date

      public Date date()
      Description copied from class: WebResource
      Returns the Date
      Specified by:
      date in class WebResource
      Returns:
      The Date
    • getSource

      public Source getSource()
      Description copied from class: WebResource
      Returns the Source
      Specified by:
      getSource in class WebResource
      Returns:
      The Source
    • onLost

      public void onLost(boolean wasCut)
    • onCopy

      public overit.geocall.clipboard.ClipboardObject onCopy()
    • onCut

      public overit.geocall.clipboard.ClipboardObject onCut()
    • onPaste

      public overit.geocall.clipboard.ClipboardObject onPaste(overit.geocall.clipboard.PasteEvent pe, boolean wasCut) throws overit.geocall.clipboard.ClipboardException
      Throws:
      overit.geocall.clipboard.ClipboardException
    • getName

      public String getName()
    • getDirectDownloadUrl

      public String getDirectDownloadUrl(overit.geocall.servlet.WebResourceUrl wru)
      Description copied from class: WebResource
      returns a direct resource download url or null if not possible
      Specified by:
      getDirectDownloadUrl in class WebResource
      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

      public String getDirectUploadUrl(overit.geocall.servlet.WebResourceUrl wru)
      Description copied from class: WebResource
      returns a direct resource upload url or null if not possible
      Specified by:
      getDirectUploadUrl in class WebResource
      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