From: <ga...@us...> - 2012-08-10 07:22:13
|
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. |