
Hi,
How to store url path in file ?
this my program
public class Image implements Runnable {
..........
public static void writeImage(BufferedImage img, String fileLocation,
String extension) {
..............
}
public static String createTimeStampStr() throws Exception {
..........
}
public void randomImage(String uname) throws Exception {
..........
Robot robot = new Robot();
BufferedImage bi = robot.createScreenCapture(new Rectangle(1000,700));
String file = "C:/xampp/htdocs/jobqueen/website/screenshots/" + username + createTimeStampStr() + ".PNG";
This is store phiscal directory but i want store url path like this www.queen.com/website/screenshots/
plz help

when i run the program I am getting this error
java.io.FileNotFoundException: http:\www.queen.com\website\screenshots\amit1220120625_104252.PNG (The filename, directory name, or volume label syntax is incorrect)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
at javax.imageio.stream.FileImageOutputStream.<init>(FileImageOutputStream.java:53)
at com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(FileImageOutputStreamSpi.java:37)
at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:393)
at javax.imageio.ImageIO.write(ImageIO.java:1514)
at Image.writeImage(Image.java:28)
at Image.randomImage(Image.java:70)
at Image.run(Image.java:119)
at java.lang.Thread.run(Thread.java:619)
java.lang.NullPointerException
at javax.imageio.ImageIO.write(ImageIO.java:1523)
at Image.writeImage(Image.java:28)
at Image.randomImage(Image.java:70)
at Image.run(Image.java:119)
at java.lang.Thread.run(Thread.java:619)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.