This content has been marked as final.
Show 4 replies
-
1. Re: SHRINKWRAP-104: Empty Directories
aslak Dec 7, 2009 3:06 AM (in response to alrubinger)What if we drop the Asset all together and make a add method like:
archive.add(Path)
Maybe we then also have to support all the convenience overloads like ?addManifestResource(Path) addWebResource(Path) etc..
Path should then probably have a isDirectory method, checking if it ends with '/' seems to be common. Could add checks to other add methods so you can't add a Asset to a directory Path, can't get the Asset of a directory path etc.. -
2. Re: SHRINKWRAP-104: Empty Directories
jesper.pedersen Dec 7, 2009 9:39 AM (in response to alrubinger)I say follow the java.io.File API and add
isFile() isDirectory()
I'll let you worry about the implementation details ;) -
3. Re: SHRINKWRAP-104: Empty Directories
alrubinger Dec 7, 2009 11:57 AM (in response to alrubinger)"aslak" wrote:
What if we drop the Asset all together and make a add method like:archive.add(Path)
@see DirectoryContainer, which has:container.addDirectory(Path); container.addDirectories(Path...); container.addDirectory(String); container.addDirectories(String...);
All spec archives types bring in DirectoryContainer support."aslak" wrote:
Path should then probably have a isDirectory method, checking if it ends with '/' seems to be common. Could add checks to other add methods so you can't add a Asset to a directory Path, can't get the Asset of a directory path etc...
Paths, as defined, don't know anything about what's under them in the context of an archive. So in my view a directory is more of an Asset; it's what's some Path in an archive.
S,
ALR -
4. Re: SHRINKWRAP-104: Empty Directories
alrubinger Jan 20, 2010 5:38 PM (in response to jesper.pedersen)jesper.pedersen wrote:
I say follow the java.io.File API and add
isFile() isDirectory()
I'll let you worry about the implementation details ;)The motivation behind ArchivePath was that it specifically did *not* follow this pattern, which IMO couples things.
On some further review, we can just say in the JavaDoc of Asset that "returning null on getInputStream() denotes a logical Path only with no content". Then we follow the API.