I want to place file IN LONG PATH created by java program

I can't place file created by java in "e.g. c:\windows\system\driver32"!!!!
but i can place in "c:\"
why?

>
I can't place file created by java in "e.g.
c:\windows\system\driver32"!!!!
but i can place in "c:\"Are you using 2 backslashes to seperate directorys? Your path should look like this in your code: c:\\windows\\system\\driver32. Post some code an we will take a look if this dosn't solve your problem.

Similar Messages

  • Where to place    text file in  Jdeveloper9irc  to read from Java program

    For ex.
    package mypackage;
    import java.io.*;
    public class ReadData
    public ReadData()
    public static void main(String[] args)
    new ReadData();
    try{
    File fin = new File("test.txt");
    if (fin.canRead())
    System.out.println("Can read file");
    I am geting a error message of file not found. Please advise
    in which directory should I place the text file "test.txt" so that the java program can read from it.
    Thanks,
    agsp

    The test.txt file should be in the 'Run Directory" of your Project. Select Project.jpr and invoke Project settings dialog.
    Click on the Runner. You will see the "Run Directory" edit field.
    For ex.
    package mypackage;
    import java.io.*;
    public class ReadData
    public ReadData()
    public static void main(String[] args)
    new ReadData();
    try{
    File fin = new File("test.txt");
    if (fin.canRead())
    System.out.println("Can read file");
    I am geting a error message of file not found. Please advise
    in which directory should I place the text file "test.txt" so that the java program can read from it.
    Thanks,
    agsp

  • How to create a file under web application root from java program

    how to create a file under web application root from java program like an action class?

    like an action class?Huh? What exactly is your requirement?
    Creating a file is usually done with java.io API. Read the java.io tutorials how to play with files.

  • Unable to see the imported files in ODI after executing my java program

    Hi,
    I am using the following java code to import the physical topology into ODI11G.
    ===========================================================================
    ImportServiceImpl importService =
    new ImportServiceImpl(pOdiInstance);
    importService.importTopologyFromFolder(importService.IMPORT_MODE_SYNONYM_INSERT_UPDATE,FolderPath, true);
    ===========================================================================
    The above code went through fine while executing my program.But, i can't able to see the imported topology in ODI.
    Can you suggest me how to import the topologies as well as work repository into ODI through Java programming.
    Thanks in advance,
    Ganesh Kesavarapu

    I would do that as a last resort, as it happens to be a client server, I don't think they'd appreciate me needing to reboot a Unix server during the day. Would anyone have any other suggestions?
    I just removed the JSPs from the live server, and refreshed the page and Tomcat could not find the JSPs, so I'm sure I have the correct directory. I then made sure the .java and .class files were deleted from the work directory, uploaded my new files (again) and hit refresh... and yet again I was served the same code as always, when I view source it still shows me the old source code even though the JSP file and compiled java files and class show that the new file should be shown, not the old one.

  • How do I place files I used to create a website into Dreamweaver's Local site folder?

    I designed a site years ago for a client. Now when I open the site in DW, the images aren't linked because there are no files in the local site folder. It must be easy - I'm just no finding the solution on my own. Thank you

    Sounds like someone moved the files out of the local site folder, probably using the OS rather than DW's Files window.
    DW just manages files on your computer, it doesn't store your files in the program. So you will have a folder somewhere on your machine with the same name that appears when you hover over the root folder at the top of your Files window in DW. You can also find the folder name under Site > Manage Sites > click the site you are working with > Site > Local Site Folder.
    You need to find that folder on your desktop, then find the images that are supposed to be in it, and move the images back.

  • How to read from a xml file(in String format) using a java program

    hi friends
    i have a string , which is xml format. i want read the values and display it.can any one suggest how to read a xml file of string format using a javaprogram
    thanks

            final DocumentBuilder db =  DocumentBuilderFactory.newInstance().newDocumentBuilder();      
            final InputStream documentStream = new ByteArrayInputStream(documentXMLSourceString.getBytes("utf-8"));
            final Document document = db.parse(documentStream);

  • How to determine path of your java program?

    hi,
    i have got some code to check what type of files are in my folders so that i can display an avaliable list of eg. save games.
    the problem is that the path of the program will change with each user that uses it cos they'll keep it somewhere else.
    so this wont work
    File f = new File("C:/Documents and Settings/Me/My Documents/GAME");is there a way to determine the whereabouts of the program thats running to change this path?
    ive already tried:
    File f = new File("");
    File f = new File("/");
    File f = new File("/GAME");but they dont work.
    thanks in advance

    Thats exactly what i needed thanks.
      import java.io.*;
       //Code by Roquefort
        public class Files
           public static void main(String[]args)
             new Files();
           public Files()
             System.out.println(System.getProperty("user.dir"));
             String dir = System.getProperty("user.dir");
             char slashChar = 92;
             char slashChar2 = 47;
             String slash = slashChar + "";
             System.out.println(dir.length());
             for(int i = 0; i < dir.length()-1; i++)
                if(dir.substring(i,i+1).equals(slash))
                   dir = dir.substring(0,i) + "/" + dir.substring(i+1,dir.length());
             System.out.println(dir);
             File f = new File(dir);
             String [] names;
             names = f.list();
             for(int a=0;a<names.length;a++)
                if(names[a].endsWith("GIF"))//Change file extension, or remove if for all files
                   System.out.println(names[a]);
       }

  • Where to store text file in Oracle9iAS created by java.io

    Hi,
    I am developing an simple application in which i have to create a text file through java.io in Runtime. I am able to create the text file but not able to store the file int he Oracle 9iAS as it is giving the error, Permission denied. I am storing my JSP files in the Oracle Application Server. I want to know the exact place where i can store the text file in Runtime.
    Thanks in Advance...
    Sivakumar

    The test.txt file should be in the 'Run Directory" of your Project. Select Project.jpr and invoke Project settings dialog.
    Click on the Runner. You will see the "Run Directory" edit field.
    For ex.
    package mypackage;
    import java.io.*;
    public class ReadData
    public ReadData()
    public static void main(String[] args)
    new ReadData();
    try{
    File fin = new File("test.txt");
    if (fin.canRead())
    System.out.println("Can read file");
    I am geting a error message of file not found. Please advise
    in which directory should I place the text file "test.txt" so that the java program can read from it.
    Thanks,
    agsp

  • Problem with creation of a jar file from inside a java program

    Hi,
    I am trying to create a jar file at runtime from within a java program.
    I am able to create a jar file just fine using:
    String[] jarArgs = new String[3];
    jarArgs[0] = "cvf";
    jarArgs[1] = "C:\temp\myjar.jar";
    jarArgs[2] = "C:\temp\this";
    sun.tools.jar.Main main1 = new sun.tools.jar.Main(System.out, System.err, "jar");
    main1.run(jarArgs);However, when I look at the jar it puts the absolute path to the files inside such as:
    C:\temp\this\is\my\package\Class.class
    instead of only this\is\my\package\Class.class
    When running the jar command from the command line it works just fine and I have the relative paths in my jar file.
    Does anyone have any experience with this and could help me out?
    Thanks in advance
    Edited by: mruf on Apr 11, 2008 1:51 AM

    Shouldn't jarArgs[2] = "-C C:\temp\this"

  • How to invoke the .bat(batch file ) from the java program

    i want to run some commands when i run one java program.
    I wrote those dos commands on the batch file and i want to include the bat file in the java program so that i can execute the bat file when i run the java program.
    tell me the way that i can run my bat file inside the java program.

    i tried this :
    a .bat file named test.bat, with this code : copy test.bat test2.bat
    a java class, Test.class, in the same directory
    public class Test {
         public static void main(String[] args) {
              try {           
                   Runtime rt = Runtime.getRuntime();
                   Process proc = rt.exec("cmd /c test.bat");
                   proc.waitFor();
                   int exitVal = proc.exitValue();
                   System.out.println("Process exitValue: " + exitVal);
              catch (Throwable t) {
                   t.printStackTrace();
    }

  • Calling an Exe in my java program using its absolute path

    hi folks .
    I m trying to execute an exe, fetching its absolute path for my java program itself .. any suggestions ..i need not to specify the path of exe everytime i execute my java program
    Thanx for ur anticipation.

    see exec() in Runtime

  • With my taking any action, my folders and files no longer appear under documents (under Places). Now a folder titled Documents has appeared on my desktop with all my files and folders. What happened?What happened?

    With my taking any action, my folders and files no longer appear under documents (under Places). Now a folder titled Documents has appeared on my desktop with all my files and folders. What happened?What happened?

    The way I moved from 10.3.9 to 10.5.8 was to use "ditto -rsrc" and copy the user homes and the data share to an external firewire drive. Then did the same in reverse.
    I found the key to data and share permissions to make sure that the users had the same UID in Leopard that they had in Panther.
    You can then use "sudo rm -rf" to remove any folder from the relocated homes that you want. Remember if you do choose to remove "~/Library" from each users relocated home, you will be removing any iCal calendars, login.keychains, browser bookmarks, custom screensavers and wallpapers, etc.
    Users don't really care if they can login and do any work. But there will be much wailing, gnashing of the teeth, and anxiety, if they lose their bookmarks and wallpaper.

  • Path and file name problem when I want to download files from html

    Hi all,
    I want to write a small program to allow users download files from jsp file
    but the following files don't work .
    <%@ page language="java" import="java.net.*,java.io.*"%>
    <%@ page import ="java.util.*"%>
    <%
    try
    String SContent = request.getParameter("click");
    String SDocName = "temp.doc"; //  out put file File Name
    ServletOutputStream stream= response.getOutputStream(); // Getting ServletOutputStream
    response.setContentType("application/msword"); // Setting content type
    response.setHeader("Content-disposition","attachment;filename=\"" +SDocName+"\""); // To pop dialog box
    BufferedInputStream in = new BufferedInputStream(new FileInputStream(SContent));
    int c;
    while ((c = in.read()) != -1){
               stream.write(c);
    in.close();
    stream.flush();
    catch(final IOException e)
    System.out.println ( "IOException." );
    catch(Exception e1)
    System.out.println ( "Exception." );
    %>I am so confuse, what is the path and file name I sould give ? for example my click should equal to http://******/Test/display.jsp?click=00-1

    Hi all,
    I got error at
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
         org.apache.coyote.tomcat5.CoyoteResponse.getWriter(CoyoteResponse.java:599)
    if I want ot download file from html file.
    String SContent = request.getParameter("click");
    if I hard code like follow it work fine.
    String SContent ="C:/Project Coding.doc";
    what mistake I make.
    Thank you!

  • Framemaker uses $filename for short file name, can we edit this to change appearance? We do not want the short file name of long filename to include the .fm extension can this be removed or modified to make this happen?

    Framemaker uses <$filename> for short file name, can we edit this to change appearance? We do not want the short file name of long filename to include the .fm extension can this be removed or modified to make this happen? In compiling our books it would be helpful to not have this extension appear as it then requires us to create extra files without them.

    See: System Variables

  • CS6 - long path names in 3D material file tabs

    When I open the materials files in a 3D file, the tabs at the top of the screen display a long and meaningless path C-_Documents and Settings_Graecyn_My Documents_Photoshop plus the name of the 3d file, plus the name of the materials file.  If I have a few material files, the actual name of the file is obscured. Is there a way to shorten that to just display the name of the material file, or the 3D file plus the material file?  I didn't see it in Preferences. It slows me down to have to go to the Windows menu to figure out which one is which. 

    The long path issue is not a PowerShell issue, but a 'feature' (some might call it a bug) in Windows. There are two main ways to work around it: make sure you don't create overly long paths and use 8.3 names. Obviously, if your users are not creating deep
    paths, you don't have the issue, but I realise persuading users to do sensible things is probably a waste of time in some cases. You could tell the users that files with names that are over long will just get deleted. It might help focus their minds?
    One possible workaround, which I've not tested, would be to dynamically create a psdrive with a drive letter that points to somwhere part way down the folder path. For example, if your path is c:\foo\bar\foobar\barfoo\x\y\FileIWantToDealWith.Txt, then create
    a new drive pointing to c:\foo\bar\foobar\barfoo\x with a drive letter of X:. then look at x:\y\FileIWantToDealWith.txt.
    Thomas Lee <[email protected]>

Maybe you are looking for

  • Single Check lot two house banks

    Hi All We have a requirement where we need to use the same check lot for two house banks. For example, check number 102 is printed from house bank 1. And i am printign next check from house bank 2, in that case it should generated check number 103 Ho

  • C8180 won't align with white paper

    Hi just bought a used C8180.  The print test shows blank for light cyan and cyan and white stripes forj light magenta and magenta. I replaced all cartriges with new ones. I've run numerouse printhead cleaning and self test reports. Black print is fin

  • HT5557 I cannot add new/pre-release books to my Wish List.

    I can add books that have been previously released. I would think that since iTunes promotes pre-release advertising that they would allow users to flag the title for future purchase. I click on the down arrow at the Buy/Order/PreOrder window but "Ad

  • Why is my reminders icon showing "1", but there's nothing in my reminders?

    Since the IOS6 upgrade, my reminders icon is showing "1" but there are no reminders set.  How do I get this "1" to disappear?

  • Getting older Lightroom serial number

    I had to replace a hard drive and need to reinstall Lightroom. I have the serial number for 4.0 but the install is asking for a previous serial number. Any suggestion on how to obtain it?