import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; public class ImagesDownloader { public static void main(String[] args) throws IOException { getImages(); } private static void getImages() throws IOException { String imagesRootPath = "http://somemanga.com/images2/"; // http://somemanga.com/images2/13342848.jpg // http://i999.mangareader.net/naruto/538/naruto-2251381.jpg for (int i = 13342848; i <= 13342848+9; i++) { URL url = new URL(String.format("%s%d.jpg", imagesRootPath, i)); InputStream in = url.openStream(); OutputStream out = new BufferedOutputStream(new FileOutputStream(String.format("D:/exam/RMI Assignment update/%d.jpg", i))); for (int b; (b = in.read()) != -1; ) { out.write(b); } out.close(); in.close(); System.out.println(String.format("Image %d.jpg from folder %s has been successfully downloaded.", i,imagesRootPath )); } } }
Friday, May 13, 2011
Image Downloader source code in Java and Manga downloader
Subscribe to:
Post Comments (Atom)
How to enable hotspot in TPG iPhone
By default, the hotspot does not work on the phone. It will ask you to contact the provider. This video will help you bypass the network ...
-
There is none who can replace him.At least the standard which he create in is life time in the running literature it never be replaceable.Th...
-
Server #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <...
-
Error: curl: (35) Unknown SSL protocol error Cause: For node.js https connection you are using invalid certificate. Invalid certificate...
No comments:
Post a Comment