How to resolve this error The filename, directory name, or volume label syntax is incorrect

How to resolve this error The filename, directory name, or volume label syntax is incorrect

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









Related Tutorials/Questions & Answers:
How to resolve this error The filename, directory name, or volume label syntax is incorrect
How to resolve this error The filename, directory name, or volume label syntax...\website\screenshots\amit1220120625_110414.PNG (The filename, directory name, or volume label syntax is incorrect) at java.io.RandomAccessFile.open(Native Method
how to resolve this JDBC Error?
how to resolve this JDBC Error?  i am trying to Exceute this code: import java.sql.DatabaseMetaData; import java.sql.Connection; import... but when i am executing this code i am getting this Error: Exception in thread
Advertisements
error occured in following page ... how to resolve it?
error occured in following page ... how to resolve it?  // to convert... error ....wht i shud do???????? i m java beginner so plz explain in smooth way.... error is:::: Exception in thread "main" java.lang.IllegalArgumentException
How to Solve the Syntax Error in java??
How to Solve the Syntax Error in java??  Syntax error in java? i have tried this program its showing error like this in Eclipse "Syntax error... of the program "objectname.i" What is the reason for this error??How to access the variable
how to display the value of termcell name in label
how to display the value of termcell name in label  want to display the tercell name in label report of pending apllication of termcellname code of the jsp page is as: <%@ taglib uri="http://displaytag.sf.net" prefix
Java get Filename without Extension
Java get Filename without Extension       In this section, you will learn how to obtain the filename without extension. For this, the file name or the directory name
Determining if a Filename path is a file or a directory
Determining if a Filename path is a file or a directory.... What you need to do, just create a File object and pass some file name or a directory in it. We are using a following methods to solve this problem.ADS
ModuleNotFoundError: No module named 'pkgutil_resolve_name'
: No module named 'pkgutil_resolve_name' How to remove the ModuleNotFoundError: No module named 'pkgutil_resolve_name' error? Thanks   Hi..., ModuleNotFoundError: No module named 'pkgutil_resolve_name' error
Why do the slashes change when the console gives me the error?
:\www.queen.com\website\screenshots\amit1220120625_110414.PNG (The filename, directory name, or volume label syntax is incorrect) at java.io.RandomAccessFile.open...Why do the slashes change when the console gives me the error?   
How to Checking Syntax Error in PHP from Command Line
How to Checking Syntax Error in PHP from Command Line  Checking Syntax Error in PHP from Command Line   PHP allows you to check your script.... It will check the syntax error in your script and show the â??Unexpected token â
Java compilation error - Java Beginners
that the file could not open for writing the filename or directory name of volume syntax is incorrect. Please help thanks  Hi Friend, Please send... compiling I create a file the package is com.deitel.ch14; the filename
sql syntax error help
sql syntax error help  this query show syntax error .. i am unable to figure it out insert into order (orderdate, dpname, paymethod, tamount...') where is the error ?   Please send the error details and the datatype
How to store url path in file ?
\screenshots\amit1220120625_104252.PNG (The filename, directory name, or volume label syntax is incorrect) at java.io.RandomAccessFile.open(Native Method...How to store url path in file ?  Hi, How to store url path in file
ERROR 601 (42P00): Syntax error. Encountered
ERROR 601 (42P00): Syntax error. Encountered   Hi, In HBase program I am executing the insert into query, but it is giving following error: ERROR 601 (42P00): Syntax error. Encountered "insert" at line 1, column 1. How
parser error xmlparseentityref no name
parser error xmlparseentityref no name  While parsing the error in my mobile application ..i'm getting the following error.. "parser error xmlparseentityref no name" and that is because of "&". I have also tried the "&
How to resolve NumberFormatException(Unlnown Source)?
How to resolve NumberFormatException(Unlnown Source)?  I'm using some code where I'm getting NumberFormatException in the code but logically it seem...=request.getParameter("time"); /* "time" is the name of the textfield from which I'm getting
How to store url path?
\amit1220120625_110414.PNG (The filename, directory name, or volume label syntax is incorrect...How to store url path?  Image is stored in physical directory like...() + ".PNG"; this physical directory is working fine but I want store in url
How to get filename in JTextArea in following case?
How to get filename in JTextArea in following case?  Hi, i'm... java.awt.*; import javax.swing.*; import java.awt.event.*; class FileName extends... pane; FileName(){ setLayout(null); JTextAreaOutputDirectory=new
Syntax error in my UPDATE..please advise
Syntax error in my UPDATE..please advise  Hi experts, I tested my code and NetBean IDE gave me the following message:- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
how to make a label left alignment?
how to make a label left alignment?  how to make a label left alignment
how to move label in jframe in java?
how to move label in jframe in java?  please any one can give me code for moving a java label in Jframe
syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement  Dear Sir ,I have write following code to save data into access databse, but code gives following error code... Access Driver] Syntax error in INSERT INTO statement. plz Help Me  Hi
runtime error:Invalid column name
runtime error:Invalid column name  Hello, Can anyone please help me on this query? Programatically it is showing run time error. But in sql query...; } } Console Output: Getting Results! java.sql.SQLException: Invalid column name
Can anybody tell me how to resolve this issue?
Can anybody tell me how to resolve this issue?  java.lang.Exception: Exception : java.lang.Exception: Generic Errors = java.util.MissingResourceException: Can't find bundle for base name Connection, locale en_US
How to set Marathi font to Label??
How to set Marathi font to Label??  Hello, I am doing one project in java-Swing Farm Management i want to set Marathi label in that so how i can? plzzzz help me its urgent
syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement   private class ButtonListener... field name 'date' in the database table 'newfresher' contradicts. Therefore change your field name 'date' to 'day' and run the following query: int i
How do I resolve this Java Class not found exception?
How do I resolve this Java Class not found exception?  Hi, Many time new developer faces the Class not found exception. Why it happens and how to resolve this? Thanks   Hi, The main reason of this exception is un
How to find MySQL data directory name?
How to find MySQL data directory name? There are various ways to find the data... is the video tutorial of: "How to find MySQL data directory name?" Method 2... "%dir"' I this tutorial you learned how to find the data directory
data type used to store name.(getting an error)
data type used to store name.(getting an error)    Statement stm... getting an error like dis: "ename cannot be resolved to a variable" whats the problem in my code and how to rectify it. plzz help n thanx in adv
How to design a music system volume button
How to design a music system volume button In this tutorial we are going to tell you how to design a music system volume button. Let's go with this example. We start here: Make a New File: Make a new file
ModuleNotFoundError: No module named 'resolve'
'resolve' How to remove the ModuleNotFoundError: No module named 'resolve..., ModuleNotFoundError: No module named 'resolve' error will be solved...ModuleNotFoundError: No module named 'resolve'  Hi, My Python
uploading a file at another system in lan using jsp
://hpws1/sharedmxd/pdf/" it gave an error message " http:\hpws1\sharedmxd\pdf\EAIMConcepts.pdf (The filename, directory name, or volume label syntax is incorrect)" How can i resolve that error??? Thanks in advance
uploading a file
",then it is giving the following error message "http://192.168.12.5:8080/tomcat-docs/myapps (The filename, directory name, or volume label syntax is incorrect)".what could be the reason for this error and how can i resolve this? Thanks
Error: /usr/sbin/ifconfig: No such file or directory
Error: /usr/sbin/ifconfig: No such file or directory  HI, I am trying to run the some setup and it throws the error: Error: /usr/sbin/ifconfig: No such file or directory How to solve this? Thanks   HI, this error
ModuleNotFoundError: No module named 'cloud-volume'
'cloud-volume' How to remove the ModuleNotFoundError: No module named 'cloud-volume' error? Thanks   Hi, In your python...-volume' error will be solved. Thanks
ModuleNotFoundError: No module named 'docker-volume'
'docker-volume' How to remove the ModuleNotFoundError: No module named 'docker-volume' error? Thanks   Hi, In your python...;docker-volume' error will be solved. Thanks
ModuleNotFoundError: No module named 'docker-volume'
'docker-volume' How to remove the ModuleNotFoundError: No module named 'docker-volume' error? Thanks   Hi, In your python...;docker-volume' error will be solved. Thanks
ModuleNotFoundError: No module named 'mac-volume'
'mac-volume' How to remove the ModuleNotFoundError: No module named 'mac-volume' error? Thanks   Hi, In your python environment you...ModuleNotFoundError: No module named 'mac-volume'  Hi, My Python
ModuleNotFoundError: No module named 'cloudmesh-volume'
named 'cloudmesh-volume' How to remove the ModuleNotFoundError: No module named 'cloudmesh-volume' error? Thanks   Hi, In your...: No module named 'cloudmesh-volume' error will be solved. Thanks
ModuleNotFoundError: No module named 'cloud-volume'
'cloud-volume' How to remove the ModuleNotFoundError: No module named 'cloud-volume' error? Thanks   Hi, In your python...-volume' error will be solved. Thanks
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.  String sql = "UPDATE emp_details SET empEname = ?, emailId = ?, guid =?, proximityCard =?, managerEmailId = ?, reviewerEmailId
my hibernate showing the following exception so how i can resolve it
my hibernate showing the following exception so how i can resolve it   Caused by: java.lang.ClassNotFoundException: org.hibernate.Session at java.net.URLClassLoader$1.run(Unknown Source
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest
ModuleNotFoundError: No module named 'sanitize-filename'
named 'sanitize-filename' How to remove the ModuleNotFoundError: No module named 'sanitize-filename' error? Thanks   Hi, In your...: No module named 'sanitize-filename' error will be solved. Thanks
ModuleNotFoundError: No module named 'wheel-filename'
named 'wheel-filename' How to remove the ModuleNotFoundError: No module named 'wheel-filename' error? Thanks   Hi, In your python... 'wheel-filename' error will be solved. Thanks
ModuleNotFoundError: No module named 'filename-sanitizer'
named 'filename-sanitizer' How to remove the ModuleNotFoundError: No module named 'filename-sanitizer' error? Thanks   Hi, In your..., ModuleNotFoundError: No module named 'filename-sanitizer' error will be solved
ModuleNotFoundError: No module named 'filename-to-fontawesome'
: No module named 'filename-to-fontawesome' How to remove the ModuleNotFoundError: No module named 'filename-to-fontawesome' error? Thanks   ...ModuleNotFoundError: No module named 'filename-to-fontawesome'  Hi
ModuleNotFoundError: No module named 'filename-transencoding'
: No module named 'filename-transencoding' How to remove the ModuleNotFoundError: No module named 'filename-transencoding' error? Thanks   Hi...ModuleNotFoundError: No module named 'filename-transencoding'  Hi
how to get the value of a label field of option tag in javascript?
how to get the value of a label field of option tag in javascript?  example <select> <option label="2" value="A">A</option> <option label="5" value="B">B</option> <
How to get the Day name
How to get the Day name  Hi, I am a beginner in Java and new to this web world as well. have a requirement to implement in my assignment project as below: We need to add the days in input date such that it create the date

Ads