Issue Details (XML | Word | Printable)

Key: TRUEZIP-171
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: christian_schlichtherle
Reporter: donaldm
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
TrueZIP

Files with a .FILE extension are not detected properly.

Created: 05/Oct/11 09:48 AM   Updated: 05/Oct/11 03:43 PM   Resolved: 05/Oct/11 02:47 PM
Component/s: TrueZIP File*
Affects Version/s: TrueZIP 7.3.2
Fix Version/s: TrueZIP 7.3.3

Time Tracking:
Not Specified

Environment:

Linux, JDK 6


Tags:
Participants: christian_schlichtherle, donaldm and qforce


 Description  « Hide

Files with a extension of .FILE appear to be incorrectly identified. For example in the following code TFile tf1 works fine but tf2.isDirectory throws an IllegalArgumentException:

File f = new File("/tmp/test.tmp");
f.delete();
com.google.common.io.Files.write("Test\n12345\n", f, Charsets.US_ASCII);
TFile tf = new TFile(f);
tf1.isDirectory();

f = new File("/tmp/test.FILE");
f.delete();
com.google.common.io.Files.write("Test\n12345\n", f, Charsets.US_ASCII);
tf2 = new TFile(f);
tf2.isDirectory();

Exception in thread "main" java.lang.IllegalArgumentException
at de.schlichtherle.truezip.fs.file.FileDriver.newController(FileDriver.java:36)
at de.schlichtherle.truezip.fs.FsAbstractCompositeDriver.newController(FsAbstractCompositeDriver.java:41)
at de.schlichtherle.truezip.fs.FsDefaultManager.getController(FsDefaultManager.java:81)
at de.schlichtherle.truezip.fs.FsDefaultManager.getController(FsDefaultManager.java:61)
at de.schlichtherle.truezip.fs.FsFailSafeManager.getController(FsFailSafeManager.java:52)
at de.schlichtherle.truezip.file.TFile.getController(TFile.java:1638)
at de.schlichtherle.truezip.file.TFile.getController(TFile.java:1634)
at de.schlichtherle.truezip.file.TFile.isDirectory(TFile.java:2108)
at tztest.TZTest.main(TZTest.java:37)

In TFile.scan
final boolean isArchive = detector.getScheme(path) != null
returns false for tf1 and true for tf2



qforce added a comment - 05/Oct/11 10:36 AM

@donaldm: I was about to submit this bug, but you beat me to it


christian_schlichtherle added a comment - 05/Oct/11 02:47 PM

Changeset: d5e0f8046b0c
Author: Christian Schlichtherle <christian AT schlichtherle DOT de>
Date: 2011-10-05 16:46
Message: Trivial.
Issue #TRUEZIP-171 - Files with a .FILE extension are not detected properly.