public int postFiles(File[] files,int startIndexInArgs,OutputStream out,String type){
  reset();
  int filesPosted=0;
  for (  File srcFile : files) {
    if (srcFile.isDirectory() && srcFile.canRead()) {
      filesPosted+=postDirectory(srcFile,out,type);
    }
 else     if (srcFile.isFile() && srcFile.canRead()) {
      filesPosted+=postFiles(new File[]{srcFile},out,type);
    }
 else {
      File parent=srcFile.getParentFile();
      if (parent == null)       parent=new File(".");
      String fileGlob=srcFile.getName();
      GlobFileFilter ff=new GlobFileFilter(fileGlob,false);
      File[] fileList=parent.listFiles(ff);
      if (fileList == null || fileList.length == 0) {
        warn("No files or directories matching " + srcFile);
        continue;
      }
      filesPosted+=postFiles(fileList,out,type);
    }
  }
  return filesPosted;
}

public int postFiles ( File [ ] files , int startIndexInArgs , OutputStream out , String type ) { reset ( ) ; int filesPosted = 0 ; for ( File srcFile : files ) { if ( srcFile . isDirectory ( ) && srcFile . canRead ( ) ) { filesPosted += postDirectory ( srcFile , out , type ) ; } else if ( srcFile . isFile ( ) && srcFile . canRead ( ) ) { filesPosted += postFiles ( new File [ ] { srcFile } , out , type ) ; } else { File parent = srcFile . getParentFile ( ) ; if ( parent == null ) parent = new File ( "." ) ; String fileGlob = srcFile . getName ( ) ; GlobFileFilter ff = new GlobFileFilter ( fileGlob , false ) ; File [ ] fileList = parent . listFiles ( ff ) ; if ( fileList == null || fileList . length == 0 ) { warn ( "No files or directories matching " + srcFile ) ; continue ; } filesPosted += postFiles ( fileList , out , type ) ; } } return filesPosted ; }
post all filenames provided in args
