Results 1 to 6 of 6

Thread: Access a file generated by server

  1. #1
    Join Date
    Dec 2009
    Posts
    204

    Access a file generated by server

    Hey everyone,
    I need a little help. I have a url that corresponds to an xml file generated by a server. The problem is that each call to this url, there are queries. It should therefore be able to copy the file locally generated power to use it as many times as you want. That is, I want to access a file which is generated by the server. I have tried this
    java.io.File dyn = new File("http://localhost:8080/......");
    Any help will be appreciated.
    Last edited by Ash maker; 25-01-2010 at 02:43 PM.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Access a file generated by server

    Hello,
    The problem is that each call to this url, there are queries. It should therefore be able to copy the file locally generated power to use it as many times as you want. That is I want to access a file which is generated by the server.
    Yes this can be done, use the URL class instead, you will find in the document of the J2SE API on the sun's official site. By my knowledge this can be best done by using the url class. Just try it and if you stuck in between the post back. If you paste your whole / full code then it will be easy for us to debug the program.

  3. #3
    Join Date
    Dec 2009
    Posts
    204

    Re: Access a file generated by server

    Hello,
    The url class which you mentioned works for me. But there was a little problem My file has accents and is encoded in utf-8. And I think when I use destinationFile.write, destinationFile being a FileOutputStream, I code my file in ANSI and not UTF-8. As an xml, I can not read: incorrect character. I think I have encountered this problem, just write with another method, but I do not know which method to use here. So, if you have any idea about the method, then let me know about it.

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Access a file generated by server

    Hello,
    Otherwise try this little snippet, try it and run your program
    Here is the code
    URL = myfile new URL(...);
    InputStream in = myFile.openStream();
    If it works well and good, if not then post the error and the code which you are using.

  5. #5
    Join Date
    Dec 2009
    Posts
    204

    Re: Access a file generated by server

    Hello,
    I am really sorry, I was not in the correct folder. That's why the file was not opening, it was not because of coding. Why this error? I have a. Xsp to the site root and a file. Xsl the xsl subdirectory, hence the error knowing that in the xsp file used by the java script is the file server and not the site. By the way thanks for the help you provided.

  6. #6
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Access a file generated by server

    Hello,
    URL = myfile new URL(...);
    InputStream in = myFile.openStream();
    How are you doing to harness the InputStream? I have no idea about it and do not think it is a good ideas to do it. I want to write the output text in a textarea in a web page.
    Textarea1.getvalue () = in. ....?
    What will the missing value. Any help on this.

Similar Threads

  1. User cannot access file on file server Windows 2008
    By Wahab4 in forum Windows Server Help
    Replies: 3
    Last Post: 13-12-2010, 05:56 PM
  2. How to use Kaspersky Anti virus to generated trace log file
    By Kallol in forum Networking & Security
    Replies: 5
    Last Post: 30-03-2010, 01:49 AM
  3. Replies: 4
    Last Post: 07-05-2009, 02:09 PM
  4. How to extract xml file generated by Grisbi
    By cobra2008 in forum Software Development
    Replies: 3
    Last Post: 06-05-2009, 03:30 PM
  5. Replies: 2
    Last Post: 24-05-2007, 09:46 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,057,259.35847 seconds with 17 queries