File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Storm Applied this week in the Other Open Source APIs forum!
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: 123
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: 2655
    
  56
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: 123
The object to be serialized has an attribute as File type.
Richard Tookey
Rancher

Joined: Aug 27, 2012
Posts: 1129
    
  17

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: 954
    
    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.