Bug 337561: Merge nsJARDirectoryInputStream into nsJARInputStream, patch by Alfred Kayser <alfredkayser@nl.ibm.com>, r+sr=darin

git-svn-id: svn://10.0.0.236/trunk@213409 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gavin%gavinsharp.com
2006-10-10 13:24:57 +00:00
parent 5d7be6c313
commit 963502e25f
8 changed files with 268 additions and 370 deletions

View File

@@ -40,7 +40,6 @@
#include "nsJAR.h"
#include "nsJARChannel.h"
#include "nsJARProtocolHandler.h"
#include "nsJARDirectoryInputStream.h"
#include "nsMimeTypes.h"
#include "nsNetUtil.h"
#include "nsInt64.h"
@@ -145,19 +144,16 @@ nsJARInputThunk::EnsureJarStream()
if (NS_FAILED(rv)) return rv;
if (ENTRY_IS_DIRECTORY(mJarEntry)) {
// This isn't simply part of nsJAR::GetInputStream because it shouldn't
// be possible to get an input stream for a directory in a zip via that
// path, just as it isn't possible to get a directory stream via an
// nsIFileInputStream
// A directory stream also needs the Spec of the FullJarURI
// because is included in the stream data itself.
nsCAutoString jarDirSpec;
rv = mFullJarURI->GetAsciiSpec(jarDirSpec);
if (NS_FAILED(rv)) return rv;
rv = nsJARDirectoryInputStream::Create(mJarReader,
jarDirSpec,
mJarEntry.get(),
getter_AddRefs(mJarStream));
rv = mJarReader->GetInputStreamWithSpec(jarDirSpec,
mJarEntry.get(),
getter_AddRefs(mJarStream));
}
else {
rv = mJarReader->GetInputStream(mJarEntry.get(),