aspose file tools*
The moose likes I/O and Streams and the fly likes File attribute in a serialized Object. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "File attribute in a serialized Object." Watch "File attribute in a serialized Object." New topic
Author

File attribute in a serialized Object.

Santosh Kumar Nayak
Ranch Hand

Joined: Aug 02, 2011
Posts: 95
In a class which is implementing Serializable Interface there exists an attribute of a File type.

How do we handle such attribute ?
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2284
    
  49
Sorry but I don't understand what your problem is, can you provide more detail.
For example: Is your problem specifically to do with serialization? what do you mean "How do we handle such attribute"?
Santosh Kumar Nayak
Ranch Hand

Joined: Aug 02, 2011
Posts: 95
The object to be serialized has an attribute as File type.
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1051
    
  10

Santosh Kumar Nayak wrote:The object to be serialized has an attribute as File type.


I don't really understand your problem since class java.io.File is serializable so an attribute of type File will be serialised when the containing class is serialised !
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
Remember that a File is just an abstract representation of a file/directory pathname.
The File class already overrides writeObject and readObject to make the path system independent when serializing and de-serializing on different systems.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File attribute in a serialized Object.