Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners How to resolve this error The filename, directory name, or volume label syntax is incorrect
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


indira
How to resolve this error The filename, directory name, or volume label syntax is incorrect
0 Answer(s)      2 years and 6 months ago
Posted in : Java Beginners


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


Advertisement
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
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
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
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
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
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
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
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 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
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
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
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
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 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
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 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 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
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
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 move a file from a directory to other directory
How to move a file from a directory to other directory  I tried the above example it will move the folder to other directory but it does not move the image file or other file to a specified directory. Can anyone help me? Thanks
how to read files of directory objective c
how to read files of directory objective c  how to read files of directory in objective c?   [[NSFileManager defaultManager] contentsOfDirectoryAtPath:bundleRoot error:nil]   To read the text file using
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 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
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
How to make directory in java
Description: This example demonstrate how to create a directory at specified path. Code: import java.io.File; public ... is that it will make a dir at root directory of C drive
Getting Exception on UseDefinedException sample program - Please help me how to resolve
Getting Exception on UseDefinedException sample program - Please help me how...(test1.java:34) what is MyException and how it called ..please explain ..?  MyException should be a class name that defined custom exception. Here
how to browse folder and directory in jsp
how to browse folder and directory in jsp  how to browse folder and directory in my jsp page.i have done my coding part for browsing directory but dont know how to get files after that.and also i want to show limited directories
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
 

 

 

DMCA.com