Class PlexusIoFileResourceCollection

    • Field Detail

      • ROLE_HINT

        public static final java.lang.String ROLE_HINT
        Role hint of this component
        See Also:
        Constant Field Values
      • baseDir

        private java.io.File baseDir
      • isFollowingSymLinks

        private boolean isFollowingSymLinks
      • filenameComparator

        private java.util.Comparator<java.lang.String> filenameComparator
        Since:
        3.2.0
    • Constructor Detail

      • PlexusIoFileResourceCollection

        public PlexusIoFileResourceCollection()
    • Method Detail

      • setBaseDir

        public void setBaseDir​(java.io.File baseDir)
        Parameters:
        baseDir - The base directory of the file collection
      • getBaseDir

        public java.io.File getBaseDir()
        Returns:
        Returns the file collections base directory.
      • isFollowingSymLinks

        public boolean isFollowingSymLinks()
        Returns:
        Returns, whether symbolic links should be followed. Defaults to true.
      • setFollowingSymLinks

        public void setFollowingSymLinks​(boolean pIsFollowingSymLinks)
        Parameters:
        pIsFollowingSymLinks - whether symbolic links should be followed
      • setDefaultAttributes

        public void setDefaultAttributes​(int uid,
                                         java.lang.String userName,
                                         int gid,
                                         java.lang.String groupName,
                                         int fileMode,
                                         int dirMode)
      • setOverrideAttributes

        public void setOverrideAttributes​(int uid,
                                          java.lang.String userName,
                                          int gid,
                                          java.lang.String groupName,
                                          int fileMode,
                                          int dirMode)
      • createDefaults

        private static PlexusIoResourceAttributes createDefaults​(int uid,
                                                                 java.lang.String userName,
                                                                 int gid,
                                                                 java.lang.String groupName,
                                                                 int mode)
      • addResources

        private void addResources​(java.util.List<PlexusIoResource> result,
                                  java.lang.String[] resources)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • stream

        public Stream stream()
        Description copied from interface: PlexusIoResourceCollection
        Returns the resources as a stream.
        Returns:
        A stream for functional iteration
      • getResources

        public java.util.Iterator<PlexusIoResource> getResources()
                                                          throws java.io.IOException
        Description copied from interface: PlexusIoResourceCollection
        Returns an iterator over the resources in the collection.
        Returns:
        An iterator
        Throws:
        java.io.IOException - .
      • isConcurrentAccessSupported

        public boolean isConcurrentAccessSupported()
        Description copied from interface: PlexusIoResourceCollection
        Indicates if this collection supports concurrent access to its resources.

        Some resource collections (like tar files) may not support efficient random access or seek operation so implementations that represent such collections may not be able to provide concurrent access to its resources. If implementation returns false, then it is not safe to access its methods and resources in concurrent fashion. For example it is not safe to read from two resources in two concurrent threads, to read a resource and iterate over the iterator returned by PlexusIoResourceCollection.getResources() in two concurrent threads, etc.

        Please note that this method indicates concurrent support only for the collection, not for the individual resources. This means there is no guarantee that the resources returned by PlexusIoResourceCollection.resolve(PlexusIoResource) or the input stream returned by PlexusIoResourceCollection.getInputStream(PlexusIoResource) are thread-safe, even if true is returned.

        Returns:
        true if this collection supports concurrent access, otherwise false
      • setFilenameComparator

        public void setFilenameComparator​(java.util.Comparator<java.lang.String> filenameComparator)
        Since:
        3.2.0