Class TemporaryWorkspaceTranslation


  • public class TemporaryWorkspaceTranslation
    extends Object
    If a treatment uses a real resource identifier for a temporary resource, it is possible that someone else accesses this temporary resource without any right.
    So, this class provides a set of tool to handle workspace which the root path of the workspace is translated.
    Author:
    Yohann Chastagnier
    • Method Detail

      • startWithTranslationDescriptorPrefix

        public static boolean startWithTranslationDescriptorPrefix​(String path)
        Indicates if the given path corresponds to a temporary workspace translation.
        Parameters:
        path - the path to verify.
        Returns:
        true if the given path is a translation, false otherwise.
      • remove

        public boolean remove()
        Removes the workspace from the filesystem.
        Returns:
        true if deletion is completely effective, false otherwise.
      • exists

        public boolean exists()
        Indicates if the workspace exists.
        Returns:
        true if it exists, false otherwise.
      • empty

        public boolean empty()
        Indicates if the workspace is empty.
        Returns:
        true if it is empty, false otherwise.
      • lastModified

        public long lastModified()
        Gets the last time the workspace was modified.
        Returns:
      • updateLastModifiedDate

        public void updateLastModifiedDate()
        Updates the last modified date of workspace.
      • getRootPath

        public File getRootPath()
        Gets the root path of the workspace.
        Returns:
      • create

        public void create()
        Create the workspace.
      • markWorkInProgress

        public void markWorkInProgress()
      • isWorkInProgress

        public boolean isWorkInProgress()
      • get

        public <T extends Serializable> T get​(String key)
        Gets from context a value from a key that has been stored into the context instance.
        Parameters:
        key - the key associated to the searched value.
        Returns:
        the value if any, null if the expected type does not match with the one of the existing value.