wood burning stoves 2.0*
The moose likes Java in General and the fly likes Copying contents... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Copying contents..." Watch "Copying contents..." New topic
Author

Copying contents...

Kedar Patwardhan
Greenhorn

Joined: Jan 24, 2007
Posts: 8
I want to ask that whether there are any APIs in Java so that we can copy the contents of a TextFile to another TextFile alongwith all TEXT properties(if they exist)in the base Textfile.By TEXT properties I mean (if the text content is BOLD or UNDERLINED or COLOURED) then it should carry all these properties to the newly created TextFile as well.

Thank You,

Regards,
Kedar.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41020
    
  43
Plain text doesn't have attributes like styles and the like - what kind of format are you using? And what do you mean by "copying" - making an exact copy of the file with a different name? To do that you wouldn't need to be concerned about file contents, though.


Ping & DNS - my free Android networking tools app
tarun bhati
Greenhorn

Joined: May 24, 2003
Posts: 1
Hello
We dont have any API for copying the text formats in the Java API
Regards
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
You could just copy the file using java.io.

With InputStream you could read the bytestream of the file and with OutputStream you could copy it to a different location.

See the following link
linkCopying One File to Another


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Copying contents...
 
Similar Threads
Need help writing to a text file
Doubt in send the data from a text file
opening file to textfield
HTML to Text via Screen scrape
Reading a textfile stored in an jar archiv