Interface FolderItem

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DATABASE_FILE_TYPE
      Underlying file is a Database
      static int DATAFILE_FILE_TYPE
      Underlying file is serialized data file
      static long DEFAULT_CHECKOUT_ID
      Default checkout ID used when a checkout is not applicable.
      static int LATEST_VERSION
      Default file version number used to indicate the latest/current version.
      static int UNKNOWN_FILE_TYPE
      Underlying file is an unknown/unsupported type.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canRecover()
      Returns true if unsaved file changes can be recovered.
      ItemCheckoutStatus checkout​(CheckoutType checkoutType, java.lang.String user, java.lang.String projectPath)
      Checkout this folder item.
      void clearCheckout()
      Clears the checkout data associated with this non-shared file.
      void delete​(int version, java.lang.String user)
      Deletes the item or a specific version.
      ItemCheckoutStatus getCheckout​(long checkoutId)
      Get the checkout status which corresponds to the specified checkout ID.
      long getCheckoutId()
      Returns the checkoutId for this file.
      ItemCheckoutStatus[] getCheckouts()
      Get all current checkouts for this item.
      int getCheckoutVersion()
      Returns the item version which was checked-out.
      java.lang.String getContentType()
      Return The content type name for this item.
      int getContentTypeVersion()
      Returns the version of content type.
      int getCurrentVersion()
      Return the latest/current version.
      java.lang.String getFileID()
      Return the file ID if one has been established or null
      int getLocalCheckoutVersion()
      Returns the local item version at the time the checkout was completed.
      java.lang.String getName()
      Return The display name for this item.
      java.lang.String getParentPath()
      Returns the path of the parent folder.
      java.lang.String getPathName()
      Return The concatenation of the pathname and the basename which can be used to uniquely identify a folder item.
      Version[] getVersions()
      Returns list of all available versions or null if item is not versioned.
      boolean hasCheckouts()
      Returns true if this item is versioned and has one or more checkouts.
      boolean isCheckedOut()
      Returns true if this item is a checked-out copy from a versioned file system.
      boolean isCheckedOutExclusive()
      Returns true if this item is a checked-out copy with exclusive access from a versioned file system.
      boolean isCheckinActive()
      Returns true if this item is versioned and has a checkin in-progress.
      boolean isReadOnly()
      Returns true if item can be overwritten/deleted.
      boolean isVersioned()
      Return true if this is a versioned item, else false
      long lastModified()
      Return The time that this item was last modified.
      long length()
      Returns the length of this domain file.
      void output​(java.io.File outputFile, int version, TaskMonitor monitor)
      Serialize (i.e., pack) this item into the specified outputFile.
      FolderItem refresh()
      Returns this instance after refresh or null if item no longer exists
      java.lang.String resetFileID()
      Assign a new file-ID to this local non-versioned file.
      void setCheckout​(long checkoutId, boolean exclusive, int checkoutVersion, int localVersion)
      Set the checkout data associated with this non-shared file.
      void setContentTypeVersion​(int version)
      Sets the version for the content type.
      void setReadOnly​(boolean state)
      Set the state of the read-only indicator for this non-shared item.
      void terminateCheckout​(long checkoutId, boolean notify)
      Terminates a checkout.
      void updateCheckoutVersion​(long checkoutId, int checkoutVersion, java.lang.String user)
      Update the checkout version associated with this versioned item.
    • Field Detail

      • UNKNOWN_FILE_TYPE

        static final int UNKNOWN_FILE_TYPE
        Underlying file is an unknown/unsupported type.
        See Also:
        Constant Field Values
      • DATABASE_FILE_TYPE

        static final int DATABASE_FILE_TYPE
        Underlying file is a Database
        See Also:
        Constant Field Values
      • DATAFILE_FILE_TYPE

        static final int DATAFILE_FILE_TYPE
        Underlying file is serialized data file
        See Also:
        Constant Field Values
      • DEFAULT_CHECKOUT_ID

        static final long DEFAULT_CHECKOUT_ID
        Default checkout ID used when a checkout is not applicable.
        See Also:
        Constant Field Values
      • LATEST_VERSION

        static final int LATEST_VERSION
        Default file version number used to indicate the latest/current version.
        See Also:
        Constant Field Values
    • Method Detail

      • getName

        java.lang.String getName()
        Return The display name for this item.
      • getFileID

        java.lang.String getFileID()
                            throws java.io.IOException
        Return the file ID if one has been established or null
        Throws:
        java.io.IOException - thrown if IO or access error occurs
      • resetFileID

        java.lang.String resetFileID()
                              throws java.io.IOException
        Assign a new file-ID to this local non-versioned file. NOTE: This method is only valid for a local non-versioned file-system.
        Returns:
        new file-ID
        Throws:
        java.io.IOException - thrown if IO or access error occurs
      • length

        long length()
             throws java.io.IOException
        Returns the length of this domain file. This size is the minimum disk space used for storing this file, but does not account for additional storage space used to tracks changes, etc.
        Returns:
        file length
        Throws:
        java.io.IOException - thrown if IO or access error occurs
      • getContentType

        java.lang.String getContentType()
        Return The content type name for this item.
      • getParentPath

        java.lang.String getParentPath()
        Returns the path of the parent folder.
      • getPathName

        java.lang.String getPathName()
        Return The concatenation of the pathname and the basename which can be used to uniquely identify a folder item.
      • isReadOnly

        boolean isReadOnly()
        Returns true if item can be overwritten/deleted.
      • setReadOnly

        void setReadOnly​(boolean state)
                  throws java.io.IOException
        Set the state of the read-only indicator for this non-shared item.
        Parameters:
        state - read-only state
        Throws:
        java.io.IOException - if an IO error occurs or item is stored on a shared file-system
      • getContentTypeVersion

        int getContentTypeVersion()
        Returns the version of content type. Note this is the version of the structure/storage for the content type, Not the users version of their data.
      • setContentTypeVersion

        void setContentTypeVersion​(int version)
                            throws java.io.IOException
        Sets the version for the content type. This will change whenever the domain objects are upgraded.
        Parameters:
        version - the new version for the content type.
        Throws:
        java.io.IOException - if an IO error occurs or item is stored on a shared file-system
      • lastModified

        long lastModified()
        Return The time that this item was last modified.
      • getCurrentVersion

        int getCurrentVersion()
        Return the latest/current version.
      • isCheckedOut

        boolean isCheckedOut()
        Returns true if this item is a checked-out copy from a versioned file system.
      • isCheckedOutExclusive

        boolean isCheckedOutExclusive()
        Returns true if this item is a checked-out copy with exclusive access from a versioned file system.
      • isVersioned

        boolean isVersioned()
                     throws java.io.IOException
        Return true if this is a versioned item, else false
        Throws:
        java.io.IOException - thrown if an IO error occurs.
      • getCheckoutId

        long getCheckoutId()
                    throws java.io.IOException
        Returns the checkoutId for this file. A value of -1 indicates a private item. NOTE: This method is only valid for a local non-versioned file-system.
        Throws:
        java.io.IOException - if an IO error occurs
      • getCheckoutVersion

        int getCheckoutVersion()
                        throws java.io.IOException
        Returns the item version which was checked-out. A value of -1 indicates a private item. NOTE: This method is only valid for a local non-versioned file-system.
        Throws:
        java.io.IOException
      • getLocalCheckoutVersion

        int getLocalCheckoutVersion()
        Returns the local item version at the time the checkout was completed. A value of -1 indicates a private item. NOTE: This method is only valid for a local non-versioned file-system.
      • setCheckout

        void setCheckout​(long checkoutId,
                         boolean exclusive,
                         int checkoutVersion,
                         int localVersion)
                  throws java.io.IOException
        Set the checkout data associated with this non-shared file. NOTE: This method is only valid for a local non-versioned file-system.
        Parameters:
        checkoutId - checkout ID (provided by ItemCheckoutStatus).
        exclusive - true if checkout is exclusive
        checkoutVersion - the item version which was checked-out (provided by ItemCheckoutStatus).
        localVersion - the local item version at the time the checkout was completed.
        Throws:
        java.io.IOException - if an IO error occurs or item is stored on a shared file-system
      • clearCheckout

        void clearCheckout()
                    throws java.io.IOException
        Clears the checkout data associated with this non-shared file. NOTE: This method is only valid for a local non-versioned file-system.
        Throws:
        java.io.IOException
      • delete

        void delete​(int version,
                    java.lang.String user)
             throws java.io.IOException
        Deletes the item or a specific version. If a specific version is specified, it must either be the oldest or latest (i.e., current).
        Parameters:
        version - specific version to be deleted, or -1 to remove all versions.
        user - user name
        Throws:
        java.io.IOException - if an IO error occurs, including the inability to delete a version because this item is checked-out, the user does not have permission, or the specified version is not the oldest or latest.
      • getVersions

        Version[] getVersions()
                       throws java.io.IOException
        Returns list of all available versions or null if item is not versioned.
        Throws:
        java.io.IOException - thrown if an IO error occurs.
      • checkout

        ItemCheckoutStatus checkout​(CheckoutType checkoutType,
                                    java.lang.String user,
                                    java.lang.String projectPath)
                             throws java.io.IOException
        Checkout this folder item.
        Parameters:
        checkoutType - type of checkout
        user - user requesting checkout
        projectPath - path of project where checkout was made
        Returns:
        checkout status or null if exclusive checkout request failed
        Throws:
        java.io.IOException - if an IO error occurs or this item is not versioned
      • terminateCheckout

        void terminateCheckout​(long checkoutId,
                               boolean notify)
                        throws java.io.IOException
        Terminates a checkout. The checkout ID becomes invalid, therefore the associated checkout copy should either be removed or converted to a private file.
        Parameters:
        checkoutId - checkout ID
        notify - if true item change notification will be sent
        Throws:
        java.io.IOException - if an IO error occurs or this item is not versioned
      • hasCheckouts

        boolean hasCheckouts()
                      throws java.io.IOException
        Returns true if this item is versioned and has one or more checkouts.
        Throws:
        java.io.IOException - if an IO error occurs
      • canRecover

        boolean canRecover()
        Returns true if unsaved file changes can be recovered.
      • getCheckout

        ItemCheckoutStatus getCheckout​(long checkoutId)
                                throws java.io.IOException
        Get the checkout status which corresponds to the specified checkout ID.
        Parameters:
        checkoutId - checkout ID
        Returns:
        checkout status or null if checkout ID not found.
        Throws:
        java.io.IOException - if an IO error occurs or this item is not versioned
      • getCheckouts

        ItemCheckoutStatus[] getCheckouts()
                                   throws java.io.IOException
        Get all current checkouts for this item.
        Returns:
        array of checkouts
        Throws:
        java.io.IOException - if an IO error occurs or this item is not versioned
      • isCheckinActive

        boolean isCheckinActive()
                         throws java.io.IOException
        Returns true if this item is versioned and has a checkin in-progress.
        Throws:
        java.io.IOException - if an IO error occurs
      • updateCheckoutVersion

        void updateCheckoutVersion​(long checkoutId,
                                   int checkoutVersion,
                                   java.lang.String user)
                            throws java.io.IOException
        Update the checkout version associated with this versioned item.
        Parameters:
        checkoutId - id corresponding to an existing checkout
        checkoutVersion -
        user -
        Throws:
        java.io.IOException - if an IO error occurs.
      • output

        void output​(java.io.File outputFile,
                    int version,
                    TaskMonitor monitor)
             throws java.io.IOException,
                    CancelledException
        Serialize (i.e., pack) this item into the specified outputFile.
        Parameters:
        outputFile - packed output file to be created
        version - if this item is versioned, specifies the version to be output, otherwise -1 should be specified.
        monitor - progress monitor
        Throws:
        java.io.IOException
        CancelledException - if monitor cancels operation
      • refresh

        FolderItem refresh()
                    throws java.io.IOException
        Returns this instance after refresh or null if item no longer exists
        Throws:
        java.io.IOException