How to store url path?

How to store url path?

Image is stored in physical directory like this String file = "C:/xampp/htdocs/jobqueen/" + username + createTimeStampStr() + ".PNG"; this physical directory is working fine 

but I want store in url path like this String file = "http://www.queen.com/website/screenshots/" + username + createTimeStampStr() + ".PNG"; 

this my program 
public class Image{ 
.............................. 

public static void writeImage(BufferedImage img, String fileLocation, 
String extension) { 
try { 
BufferedImage bi = img; 
File outputfile = new File(fileLocation); 
ImageIO.write(bi, extension, outputfile); 
} catch (IOException e) { 
e.printStackTrace(); 
} 
} 
public static String createTimeStampStr() throws Exception { 
................... 
} 
public void randomImage(String uname) throws Exception { 
..................... 

Robot robot = new Robot(); 
BufferedImage bi = robot.createScreenCapture(new Rectangle(1000,900)); 

String file = "http://www.queen.com/website/screenshots/" + username + createTimeStampStr() + ".PNG"; 
writeImage( bi, file, "PNG"); 
} 
} 


when I run this program i am getting this error 



java.io.FileNotFoundException: http:\www.queen.com\website\screenshots\amit1220120625_110414.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:29) 
at Image.randomImage(Image.java:71) 
at Image.run(Image.java:120) 
at java.lang.Thread.run(Thread.java:619) 
java.lang.NullPointerException 
at javax.imageio.ImageIO.write(ImageIO.java:1523) 
at Image.writeImage(Image.java:29) 
at Image.randomImage(Image.java:71) 
at Image.run(Image.java:120) 
at java.lang.Thread.run(Thread.java:619) 


plz need help
View Answers

June 26, 2012 at 9:13 AM

plz give reply









Related Tutorials/Questions & Answers:
How to store url path?
How to store url path in file ?
Advertisements
ModuleNotFoundError: No module named 'path3'
How to capture screenshot in url?
ModuleNotFoundError: No module named 'paths'
ModuleNotFoundError: No module named 'paths'
identify the paths
How to store image into database
How to store an image in database
ModuleNotFoundError: No module named 'paths-graph'
ModuleNotFoundError: No module named 'paths-graph'
ModuleNotFoundError: No module named 'traitlets-paths'
ModuleNotFoundError: No module named 'dict-paths'
ModuleNotFoundError: No module named 'dict-paths'
ModuleNotFoundError: No module named 'restricted-paths'
ModuleNotFoundError: No module named 'generic-paths'
how to write store procedure in sql
how to store,retrieve,modify the data
How to do url rewritting?
ModuleNotFoundError: No module named 'dict-values-paths'
ModuleNotFoundError: No module named 'canonicalwebteam.yaml-deleted-paths'
ModuleNotFoundError: No module named 'django-materialized-paths'
ModuleNotFoundError: No module named 'mercurial_all_paths'
ModuleNotFoundError: No module named 'simple_paths_algorithm'
ModuleNotFoundError: No module named 'canonicalwebteam.yaml-deleted-paths'
ModuleNotFoundError: No module named 'dict-values-paths'
ModuleNotFoundError: No module named 'django-materialized-paths'
ModuleNotFoundError: No module named 'django-restricted-paths'
How to open URL in iPhone SDK
how can we store the encrypted passwaord in swings?
How to Store Image using JSF
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?
how to store and then immediately retrieve when store the image into database?
How to Store Date - Java Beginners
how to store dynamic array in hidden field in javascript?
How to capture video and then how to store it in mobile memory
store
How to store JComboBox item into database
com.slamdata - pathy-scalacheck_2.11 version 0.2.7 Maven dependency. How to use pathy-scalacheck_2.11 version 0.2.7 in pom.xml?
com.slamdata - pathy-scalacheck_2.10 version 0.2.11 Maven dependency. How to use pathy-scalacheck_2.10 version 0.2.11 in pom.xml?
com.slamdata - pathy-core_2.12 version 0.2.5 Maven dependency. How to use pathy-core_2.12 version 0.2.5 in pom.xml?
store
How to print a webpage without url and date in jsp ?
How to store and retrieve image from database in JSP?
How To Store Image Into MySQL Using Java
how to store data in XML file - JSP-Servlet
how to store/retrieve doc file - Java Beginners
ModuleNotFoundError: No module named 'Python-video-annotator-module-create-paths'
ModuleNotFoundError: No module named 'Python-video-annotator-module-smooth-paths'

Ads