Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copying contents...

 
Kedar Patwardhan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
tarun bhati
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
We dont have any API for copying the text formats in the Java API
Regards
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic