ето ви чудно-кретенска програмка за сваляне на картинки с имена номера :
import java.io.*;
import java.net.*;
class ivan
{
static String fixNumber( int numberVal )
{
String str="";
if( numberVal < 10 )
str = "00000" + Integer.toString(numberVal) + ".jpg";
if( numberVal >= 10 && numberVal < 100 )
str = "0000" + Integer.toString(numberVal) + ".jpg";
if( numberVal >= 100 && numberVal < 1000 )
str = "000" + Integer.toString(numberVal) + ".jpg";
if( numberVal >= 1000 && numberVal <= 10000 )
str = "00" + Integer.toString(numberVal) + ".jpg";
return str;
}
public static void main( String[] args )
{
String URLDir = "
http://adme.ru/cannes2003prints/";
for( int m = 1; m <= 8715; m++ )
{
try
{
String fileName = fixNumber( m );
File f = new File( fileName );
if( !f.exists() )
{
URL url = new URL( URLDir + fileName );
InputStream is = url.openStream();
FileOutputStream fos = new FileOutputStream( fileName );
System.out.println( "File: " + fileName );
System.err.println( "File: " + fileName );
int buf;
while( ( buf = is.read() ) != -1 )
fos.write( buf );
fos.close();
}
}
catch( Exception e )
{
System.out.println( e );
System.err.println( e );
}
}
}
}