agave-common/common-core/src/main/java/org/iplantc/service/common/auth/TrustedCALocation.java
/**
	 * Unpacks expanded archive by flattening the source directory tree and copying all
	 * files to the dest directory.
	 * 
	 * @param source
	 * @param dest
	 * @throws IOException
	 */
Unpacks expanded archive by flattening the source directory tree and copying all
files to the dest directory.

@param source
@param dest
@throws IOException
Unpacks expanded archive by flattening the source directory tree and copying all files to the dest directory . @param source @param dest @throws IOException
private void unpackTrustroots(final File source, final File dest) 
	throws IOException 
	{	
		Set<FileVisitOption> visitOptions = new HashSet<FileVisitOption>();
		visitOptions.add(FileVisitOption.FOLLOW_LINKS);
		Path src = FileSystems.getDefault().getPath(source.getAbsolutePath());
		Files.walkFileTree(src, visitOptions, 5, new SimpleFileVisitor<Path>() {	
			@Override
			public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
			throws IOException
			{   
			    if (attrs.isRegularFile()) {
				    try {
				        FileUtils.copyFileToDirectory(file.toFile(), dest);
				    } catch (IOException e) {
				        if (e.getMessage().contains("Failed to copy full contents")) {
				            log.debug("Retrying failed unpacking of trustroots. " + e.getMessage());
				            FileUtils.copyFileToDirectory(file.toFile(), dest);
				        }
				    }
			    }
				return FileVisitResult.CONTINUE;
			}
			@Override
			public FileVisitResult postVisitDirectory(Path dir, IOException e)
			throws IOException
			{
				if (e == null) {
					return FileVisitResult.CONTINUE;
				} else {
					throw e;
				}
			}
		});
	}
private void unpackTrustroots ( final File source , final File dest ) throws IOException { Set < FileVisitOption > visitOptions = new HashSet < FileVisitOption > ( ) ; visitOptions . add ( FileVisitOption . FOLLOW_LINKS ) ; Path src = FileSystems . getDefault ( ) . getPath ( source . getAbsolutePath ( ) ) ; Files . walkFileTree ( src , visitOptions , 5 , new SimpleFileVisitor < Path > ( ) { @ Override public FileVisitResult visitFile ( Path file , BasicFileAttributes attrs ) throws IOException { if ( attrs . isRegularFile ( ) ) { try { FileUtils . copyFileToDirectory ( file . toFile ( ) , dest ) ; } catch ( IOException e ) { if ( e . getMessage ( ) . contains ( "Failed to copy full contents" ) ) { log . debug ( "Retrying failed unpacking of trustroots. " + e . getMessage ( ) ) ; FileUtils . copyFileToDirectory ( file . toFile ( ) , dest ) ; } } } return FileVisitResult . CONTINUE ; } @ Override public FileVisitResult postVisitDirectory ( Path dir , IOException e ) throws IOException { if ( e == null ) { return FileVisitResult . CONTINUE ; } else { throw e ; } } } ) ; }
Unpacks expanded archive by flattening the source directory tree and copying all
 files to the dest directory.
Unpacks expanded archive by flattening the source directory tree and copying all files to the dest directory .
// need to add logic to maintain symlinks  // retry generally this happens when there are a lot of symbolic // links. usually works second time with out a hitch. // directory iteration failed