import java.io.*; import java.util.*; /*------------------------------- how to: java ImageCopy t.txt abcde --------------------------------*/ public class ImageNo { static Runtime r = Runtime.getRuntime(); public static void main ( String args[] ) { String iPath = ""; String tPath = "/www/images/copy/"; String iV = args[1]; boolean isA = false; boolean isB = false; boolean isC = false; boolean isD = false; boolean isE = false; boolean isF = false; if ( iV.indexOf("a") >= 0 ) isA = true; if ( iV.indexOf("b") >= 0 ) isB = true; if ( iV.indexOf("c") >= 0 ) isC = true; if ( iV.indexOf("d") >= 0 ) isD = true; if ( iV.indexOf("e") >= 0 ) isE = true; if ( iV.indexOf("f") >= 0 ) isF = true; Vector vc = fileRead ( args[0] ); for ( int i = 0; i < vc.size(); i++) { iPath = "/www/images/prdimg/"+vc.elementAt(i).toString().substring(0,1)+"/"+vc.elementAt(i).toString().substring(0,2)+"/"+vc.elementAt(i).toString().substring(0,3)+"/"; if ( isA ) { if ( !isFileExit ( iPath + vc.elementAt(i).toString() + "_a.gif" ) ) { System.out.println ( vc.elementAt(i).toString() ); } } if ( isB ) { if ( !isFileExit ( iPath + vc.elementAt(i).toString() + "_b.gif" ) ) { System.out.println ( vc.elementAt(i).toString() ); } } if ( isC ) { if ( !isFileExit ( iPath + vc.elementAt(i).toString() + "_c.gif" ) ) { System.out.println ( vc.elementAt(i).toString() ); } } if ( isD ) { if ( !isFileExit ( iPath + vc.elementAt(i).toString() + "_d.gif" ) ) { System.out.print( "/" + vc.elementAt(i).toString() +"/" ); } } if ( isE ) { if ( !isFileExit ( iPath + vc.elementAt(i).toString() + "_e.gif" ) ) { System.out.println ( vc.elementAt(i).toString() ); } } if ( isF ) { if ( !isFileExit ( iPath + vc.elementAt(i).toString() + "_f.gif" ) ) { System.out.println ( vc.elementAt(i).toString() ); } } } } public static Vector fileRead( String fileName ) { Vector vcF = new Vector(); try { BufferedReader in = new BufferedReader( new FileReader(fileName) ); String temp = null; while((temp = in.readLine()) !=null){ vcF.addElement( temp ); } return vcF ; } catch(IOException e){ e.printStackTrace(); return vcF ; } } public static void bCopy ( String a, String b, String c) { try { copy ( a+c, b+c ); } catch(IOException e) { System.out.println ( e); } } public static void copy ( String a, String b ) throws IOException { System.out.println("copy: " + a); r.exec("cp "+ a + " " + b ); r.gc(); } public static boolean isFileExit( String fileName ) { File f = new File( fileName ); return f.exists() ; } }