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

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 a month 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 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
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
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 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
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
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 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
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
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
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
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 copy the directory in to ftp server using java
how to copy the directory in to ftp server using java  how to copy the directory in to ftp server using java ?   Hello venaktehs As much... working directory with the same name (which you wish to copy) as: issueCommand
Converting a Filename to a URL
Converting a Filename to a URL       A file object is used to a give a filename. Creating the File...() : It is used to convert the file name into the URL. getFile() : This is the method
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
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 load file from the directory in J2ME?
How to load file from the directory in J2ME?  Video player J2ME. I have a folder name "music". I want to display all file with extension is "*.mpg" on the List. How can I do it, plz help me
Java get class directory
Java get class directory       In this section of example we are going to describe you how to fetch the class directory's path by the class name. To get the class directory's
Creating Volume Bar Using Gauge Class
been set with the form.  We can also set the new volume label... Creating Volume Bar Using Gauge Class       This example is all about creating a volume bar
how to resolve the problem like when i extract the struts-blank-1.3.10.war it shows java .io.filenotfound
how to resolve the problem like when i extract the struts-blank-1.3.10.war it shows java .io.filenotfound  Hai, To Extract war file jar -xvf struts-blank-1.3.10.jar it shows the below one Microsoft Windows [Version 6.1.7600
Upgraded MySQL from 5.1 to 5.5, running into PDOException: SQLSTATE[42000]: Syntax error or
Upgraded MySQL from 5.1 to 5.5, running into PDOException: SQLSTATE[42000]: Syntax error or  Upgraded MySQL from 5.1 to 5.5, running into PDOException: SQLSTATE[42000]: Syntax error or
Label
Label       A displayed label object is known as the Label. Most of the times label is used... the functioning of the next text field. A label is also restricted to a single line
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
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
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code  hi, I have done a program whereby... { private String filename; private int count; Abc( String name ) { filename
How to find a servlet object by name?
How to find a servlet object by name?  How can we locate a servlet object in the code by it's object name?   A. In web.xml you map servlet and define url pattern. Now this url-pattern is used for calling servlet. <
Java filename without extension
Java filename without extension In his section, you will learn how to get the file name without extension. Description of code: In one of the previous.... Here we going to do just reverse of that i.e retrieving file name from the given
How to extract name,surname, doamin name from mailid
How to extract name,surname, doamin name from mailid  Hi sir How to extract name,surname, doamin name from mailid using java coding? for example, i want to extract first name as swamy, surname as nandha and domain
Interactive, Non-Interactive Gauge Example
the volume label. The javax.microedition.lcdui.Gauge class has only one constructor as: Gauge(String label, boolean interactive, int maxValue, int initialValue...;    This example shows, how to create the Gauge class
how to get java path name
How to write script in Java  <html> <head> <script>alert('ok')</script> </head> </Html>
 

 

 

DMCA.com