DistCpUtils { public static EnumSet<FileAttribute> unpackAttributes(String attributes) { EnumSet<FileAttribute> retValue = EnumSet.noneOf(FileAttribute.class); if (attributes != null) { for (int index = 0; index < attributes.length(); index++) { retValue.add(FileAttribute.getAttribute(attributes.charAt(index))); } } return retValue; }  static long getFileSize(Path path, Configuration configuration); static void publish(Configuration configuration,
                                 String label, T value); static int getInt(Configuration configuration, String label); static long getLong(Configuration configuration, String label); static Class<? extends InputFormat> getStrategy(Configuration conf,
      DistCpContext context); static String getRelativePath(Path sourceRootPath, Path childPath); static String packAttributes(EnumSet<FileAttribute> attributes); static EnumSet<FileAttribute> unpackAttributes(String attributes); static void preserve(FileSystem targetFS, Path path,
                              CopyListingFileStatus srcFileStatus,
                              EnumSet<FileAttribute> attributes,
                              boolean preserveRawXattrs); static List<AclEntry> getAcl(FileSystem fileSystem,
      FileStatus fileStatus); static Map<String, byte[]> getXAttrs(FileSystem fileSystem,
      Path path); static LinkedList<CopyListingFileStatus> toCopyListingFileStatus(
      FileSystem fileSystem, FileStatus fileStatus, boolean preserveAcls,
      boolean preserveXAttrs, boolean preserveRawXAttrs, int blocksPerChunk); static CopyListingFileStatus toCopyListingFileStatusHelper(
      FileSystem fileSystem, FileStatus fileStatus, boolean preserveAcls, 
      boolean preserveXAttrs, boolean preserveRawXAttrs,
      long chunkOffset, long chunkLength); static Path sortListing(Configuration conf,
      Path sourceListing); static void sortListing(final Configuration conf,
      final Path sourceListing,
      final Path output); static void checkFileSystemAclSupport(FileSystem fs); static void checkFileSystemXAttrSupport(FileSystem fs); static DecimalFormat getFormatter(); static String getStringDescriptionFor(long nBytes); static boolean checksumsAreEqual(FileSystem sourceFS, Path source,
      FileChecksum sourceChecksum, FileSystem targetFS, Path target); static Path getSplitChunkPath(Path targetFile,
      CopyListingFileStatus srcFileStatus);  }
@Test public void testUnpackAttributes() { EnumSet<FileAttribute> attributes = EnumSet.allOf(FileAttribute.class); Assert.assertEquals(attributes, DistCpUtils.unpackAttributes("RCBUGPAXT")); attributes.remove(FileAttribute.REPLICATION); attributes.remove(FileAttribute.CHECKSUMTYPE); attributes.remove(FileAttribute.ACL); attributes.remove(FileAttribute.XATTR); Assert.assertEquals(attributes, DistCpUtils.unpackAttributes("BUGPT")); attributes.remove(FileAttribute.TIMES); Assert.assertEquals(attributes, DistCpUtils.unpackAttributes("BUGP")); attributes.remove(FileAttribute.BLOCKSIZE); Assert.assertEquals(attributes, DistCpUtils.unpackAttributes("UGP")); attributes.remove(FileAttribute.GROUP); Assert.assertEquals(attributes, DistCpUtils.unpackAttributes("UP")); attributes.remove(FileAttribute.USER); Assert.assertEquals(attributes, DistCpUtils.unpackAttributes("P")); attributes.remove(FileAttribute.PERMISSION); Assert.assertEquals(attributes, DistCpUtils.unpackAttributes("")); }