protected boolean copyTo(LinkedList files,String todteddir){
  if (files == null) {
    Debug.error("No files configured for copying!");
    return false;
  }
  Iterator it=files.iterator();
  while (it.hasNext()) {
    File file=(File)it.next();
    DTEDNameTranslator dnt=locator.getTranslator();
    try {
      dnt.set(file.getAbsolutePath());
      String dsd=dnt.getSubDirs();
      if (dsd != null && dsd.length() > 0) {
        dsd="/" + dsd;
      }
      File toDir=new File(todteddir + dsd);
      if (!toDir.exists()) {
        toDir.mkdirs();
      }
      File outputFile=new File(toDir,dnt.getFileName());
      if (Debug.debugging("dted")) {
        Debug.output("DTEDAdmin copying " + file.getAbsolutePath() + " to "+ outputFile.getAbsolutePath());
      }
      BinaryBufferedFile input=new BinaryBufferedFile(file);
      RandomAccessFile output=new RandomAccessFile(outputFile,"rw");
      byte[] bytes=new byte[4096];
      int numBytes=input.read(bytes);
      while (numBytes > 0) {
        output.write(bytes,0,numBytes);
        numBytes=input.read(bytes);
      }
      input.close();
      output.close();
    }
 catch (    FormatException fe) {
      continue;
    }
catch (    IOException ioe) {
      continue;
    }
  }
  return true;
}

protected boolean copyTo ( LinkedList files , String todteddir ) { if ( files == null ) { Debug . error ( "No files configured for copying!" ) ; return false ; } Iterator it = files . iterator ( ) ; while ( it . hasNext ( ) ) { File file = ( File ) it . next ( ) ; DTEDNameTranslator dnt = locator . getTranslator ( ) ; try { dnt . set ( file . getAbsolutePath ( ) ) ; String dsd = dnt . getSubDirs ( ) ; if ( dsd != null && dsd . length ( ) > 0 ) { dsd = "/" + dsd ; } File toDir = new File ( todteddir + dsd ) ; if ( ! toDir . exists ( ) ) { toDir . mkdirs ( ) ; } File outputFile = new File ( toDir , dnt . getFileName ( ) ) ; if ( Debug . debugging ( "dted" ) ) { Debug . output ( "DTEDAdmin copying " + file . getAbsolutePath ( ) + " to " + outputFile . getAbsolutePath ( ) ) ; } BinaryBufferedFile input = new BinaryBufferedFile ( file ) ; RandomAccessFile output = new RandomAccessFile ( outputFile , "rw" ) ; byte [ ] bytes = new byte [ 4096 ] ; int numBytes = input . read ( bytes ) ; while ( numBytes > 0 ) { output . write ( bytes , 0 , numBytes ) ; numBytes = input . read ( bytes ) ; } input . close ( ) ; output . close ( ) ; } catch ( FormatException fe ) { continue ; } catch ( IOException ioe ) { continue ; } } return true ; }
get the internal frame list and copy those frames to the given directory .
