Revision: 5923 http://jnode.svn.sourceforge.net/jnode/?rev=5923&view=rev Author: galatnm Date: 2012-08-10 07:22:07 +0000 (Fri, 10 Aug 2012) Log Message: ----------- Expose some more HFS+ entry details
Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2012-08-10 07:20:25 UTC (rev 5922) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2012-08-10 07:22:07 UTC (rev 5923) @@ -141,6 +141,22 @@ return (type == AbstractFSEntry.FILE_ENTRY); } + public CatalogFile createCatalogFile() { + if (!isFile()) { + throw new IllegalStateException("Attempted to create a catalog file but this entry is not a file!"); + } + + return new CatalogFile(getData()); + } + + public CatalogFolder createCatalogFolder() { + if (isFile()) { + throw new IllegalStateException("Attempted to create a catalog folder but this entry is not a directory!"); + } + + return new CatalogFolder(getData()); + } + @Override public void setLastModified(long lastModified) throws IOException { if (isFile()) { @@ -191,4 +207,15 @@ return catalogFolder.getCreateDate(); } } + + public long getLastAccessed() throws IOException { + if (isFile()) { + CatalogFile catalogFile = new CatalogFile(getData()); + return catalogFile.getAccessDate(); + } + else { + CatalogFolder catalogFolder = new CatalogFolder(getData()); + return catalogFolder.getAccessDate(); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Jnode-svn-commits mailing list Jnode-svn-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jnode-svn-commits