Solved

How to write to a file in Java?

Posted on 2010-08-19
1
318 Views
Last Modified: 2013-11-24
Hello,

I want to write to the network and this is the path that I have:
http://s306a5e/wasipm/Synchronize changes with Nodes.doc

when I use it for a link in html it works. but when I want to write  a new file to the directory in java it does not work.

I have tried something like these:
href="http://s306a5e/wasipm/Synchronize.doc

acronym = "CBSV";

1. String filename = "http://s306a5e/wasip/"+ acronym + "_ServerRequest.txt";
java.io.FileNotFoundException: http:\s306a5e\wasip\CBSV_ServerRequest.txt (The filename, directory name, or volume label syntax is incorrect.)

2. String filename = "http:////s306a5e/wasip/"+ acronym + "_ServerRequest.txt";
http:\s306a5e\wasip\CBSV_ServerRequest.txt (The filename, directory name, or volume label syntax is incorrect.)


Thanks very much for any advice,

0
Comment
Question by:DESEI-SELB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
Hegemon earned 125 total points
ID: 33477059
http is a network protocol. You cannot write to a file using http protocol. To write to a file, you need to have access to the file by means of a file system, whether the file is local or remote.

Specifying http: as a file access protocol is wrong.
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question