Class FolderArtifact

    • Field Detail

      • path

        private Path path
      • isTemporary

        private boolean isTemporary
    • Constructor Detail

      • FolderArtifact

        protected FolderArtifact​(Path path)
        Creates a path artifact from the given path. A path may be a (regular) pattern!
        Parameters:
        path - the path representing the folder
      • FolderArtifact

        protected FolderArtifact​(java.io.File file,
                                 ArtifactModel model)
        Creates a path artifact from the given file. A path may be a (regular) pattern!
        Parameters:
        file - the file representing the path
        model - the artifact model to create this folder artifact within
    • Method Detail

      • create

        public static FolderArtifact create()
                                     throws VilException
        Creates a temporary file artifact.
        Returns:
        the created file artifact
        Throws:
        VilException - in case that the creation fails
      • delete

        public void delete()
                    throws VilException
        Description copied from interface: IArtifact
        Deletes this artifact.
        Specified by:
        delete in interface IArtifact
        Throws:
        VilException - in case of serious problems so that this operation cannot continue
      • getName

        public java.lang.String getName()
                                 throws VilException
        Description copied from interface: IArtifact
        Returns the name of this artifact.
        Specified by:
        getName in interface IArtifact
        Returns:
        the name of this artifact
        Throws:
        VilException - in case of serious problems so that this operation cannot continue
      • rename

        public void rename​(java.lang.String name)
                    throws VilException
        Description copied from interface: IArtifact
        Renames this artifact.
        Specified by:
        rename in interface IArtifact
        Parameters:
        name - the new name of this artifact
        Throws:
        VilException - in case of serious problems so that this operation cannot continue
      • getText

        public Text getText()
                     throws VilException
        Description copied from interface: IArtifact
        Returns the textual representation of the contents of this artifact for manipulation. In case of binary artifacts, the returned object may be empty.
        Specified by:
        getText in interface IArtifact
        Returns:
        the textual representation of the contents
        Throws:
        VilException - in case of obtaining the representation causes serious problems
      • getBinary

        public Binary getBinary()
                         throws VilException
        Description copied from interface: IArtifact
        Returns the binary representation of the contents of this artifact for manipulation.
        Specified by:
        getBinary in interface IArtifact
        Returns:
        the binary representation of the contents
        Throws:
        VilException - in case of obtaining the representation causes serious problems
      • accept

        public void accept​(IArtifactVisitor visitor)
        Description copied from interface: IArtifact
        Visits this artifact (and dependent on the visitor also contained artifacts and fragments) using the given visitor.
        Specified by:
        accept in interface IArtifact
        Parameters:
        visitor - the visitor used for visiting this artifact
      • getPath

        public Path getPath()
        Description copied from interface: IFileSystemArtifact
        Returns the path artifact representing the path to this file system artifact. The absolute and simple name can be obtained from the path. Note that IArtifact.getName() will return the simple name of this artifact.
        Specified by:
        getPath in interface IFileSystemArtifact
        Returns:
        the path
      • copy

        public Set<IFileSystemArtifact> copy​(IFileSystemArtifact target)
                                      throws VilException
        Description copied from interface: IFileSystemArtifact
        Copy this artifact.
        Specified by:
        copy in interface IFileSystemArtifact
        Parameters:
        target - the target artifact. In case of a file, the target is supposed to be overridden by a copy of this artifact. In case of a directory, a copy of this artifact shall after this operation be part of the directory.
        Returns:
        this (for chained operations)
        Throws:
        VilException - in case of serious problems
      • selectAll

        public Set<FileArtifact> selectAll()
                                    throws VilException
        Returns the contained file system artifacts, i.e., folder and file artifacts.
        Returns:
        the contained artifacts as collection
        Throws:
        VilException - in case that obtaining the artifacts fails
      • artifactChanged

        public void artifactChanged​(java.lang.Object cause)
                             throws VilException
        Description copied from interface: IArtifactChangedListener
        Is called when the artifact was changed, e.g., to trigger a reanalysis of substructures.
        Specified by:
        artifactChanged in interface IArtifactChangedListener
        Parameters:
        cause - the cause for the change, e.g., an artifact representation
        Throws:
        VilException - in case that the required operations fail for some reason
      • convert

        public static FolderArtifact convert​(java.lang.String val)
        Conversion operation.
        Parameters:
        val - the value to be converted
        Returns:
        the converted value
      • convert

        public static Path convert​(FolderArtifact val)
                            throws VilException
        Conversion operation.
        Parameters:
        val - the value to be converted
        Returns:
        the converted value
        Throws:
        VilException - in case of problems
      • convert

        public static FolderArtifact convert​(Path path)
                                      throws VilException
        Converts a path into a folder.
        Parameters:
        path - the path to be converted
        Returns:
        the resulting folder
        Throws:
        VilException - in case of problems
      • lastModification

        public long lastModification()
        Description copied from interface: IArtifact
        Returns the last modification timestamp of this artifact.
        Specified by:
        lastModification in interface IArtifact
        Returns:
        the last modification timestamp, 0 if unknown
      • exists

        public boolean exists()
        Description copied from interface: IArtifact
        Returns whether this artifact is exists.
        Specified by:
        exists in interface IArtifact
        Returns:
        true if this artifact exists, false else
      • getStringValue

        public java.lang.String getStringValue​(IStringValueProvider.StringComparator comparator)
        Description copied from interface: IStringValueProvider
        Returns the string value of this object.
        Specified by:
        getStringValue in interface IStringValueProvider
        Parameters:
        comparator - if the sequence of elements, e.g., in case of collections, shall be ordered according to the comparator, null if the original sequence shall be returned
        Returns:
        the string value
      • store

        public void store()
                   throws VilException
        Description copied from interface: IArtifact
        Stores this artifact in case of changes.
        Specified by:
        store in interface IArtifact
        Throws:
        VilException - in case of problems storing this artifact
      • isTemporary

        public boolean isTemporary()
        Returns whether this artifact is (considered to be) a temporary artifact.
        Specified by:
        isTemporary in interface IFileSystemArtifact
        Returns:
        true if it is temporary, false else
      • update

        public void update()
                    throws VilException
        Description copied from interface: IArtifact
        Called if the underlying real artifact may have been updated, e.g., by overriding it by another file.
        Specified by:
        update in interface IArtifact
        Throws:
        VilException - in case that updating fails
      • determineActualValue

        public java.lang.Object determineActualValue​(java.lang.Object object)
        Description copied from interface: IActualValueProvider
        Determines a more actual value for object in the context of using it for this type. Default types implementing this interface shall not use their attributes as this method will be called via a template object.
        Specified by:
        determineActualValue in interface IActualValueProvider
        Parameters:
        object - the initial object (may be null)
        Returns:
        the actual object (may be object if no actual value is available, may be null if object was null)