Solved

How to write to a file in Java?

Posted on 2010-08-19
1
309 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
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now