Skip to main content

[truezip-issues] [JIRA] Commented: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

  • From: "palich (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [truezip-issues] [JIRA] Commented: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist
  • Date: Thu, 6 Jun 2013 08:27:18 +0000 (UTC)
  • Auto-submitted: auto-generated


    [ 
https://java.net/jira/browse/TRUEZIP-321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=365094#action_365094
 ] 

palich commented on TRUEZIP-321:
--------------------------------

Attaching complete sample JUnit Test:

{code}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import de.schlichtherle.truezip.file.TFile;

public class TempDirTest {

        @Test
        public void test() {
                System.setProperty("java.io.tmpdir", "target/temp");

                // ZIP file OK
                TFile archive = new TFile("src/test/resources/archive.zip");
                assertArchive(archive);

                // Sub ZIP file FAILS
                TFile subArchive = new 
TFile("src/test/resources/archive.zip/files.zip");
                assertArchive(subArchive);
        }

        private void assertArchive(TFile file) {
                assertTrue("File must exist: " + file, file.exists());
                assertTrue("File must be detected as archive: " + file,
                                file.isArchive());
                assertTrue("File must act like a directory: " + file,
                                file.isDirectory());
                // See TFile#falsePositives
                assertEquals("File length must be 0: " + file, 0l, 
file.length());
        }
}

{code}

> TrueZip does not detect sub archives when Java's temp directory does not 
> exist
> ------------------------------------------------------------------------------
>
>                 Key: TRUEZIP-321
>                 URL: https://java.net/jira/browse/TRUEZIP-321
>             Project: TrueZIP
>          Issue Type: Bug
>          Components: TrueZIP Kernel
>    Affects Versions: TrueZIP 7.7
>         Environment: Windows 7, 32 or 64 Bit, Java 1.6.0_26-32bit
>            Reporter: palich
>            Assignee: Christian Schlichtherle
>
> If the system property {{java.io.tmpdir}} refers to a non-existing 
> directory, TrueZip is not able to detect or access sub archives.
> The assertion from the following test excerpt fails:
> {code}
> System.setProperty("java.io.tmpdir", "target/temp");
> TFile subArchive = new TFile("src/test/resources/archive.zip/files.zip");
> assertTrue("File must act like a directory: " + subArchive, 
> file.isDirectory());
> {code}
> I know that {{java.io.tmpdir}} should always exist. But the real world 
> sometimes is different. At least TrueZip should test it and log a warning 
> to the console. Otherwise, the reason for a failed archive detection is 
> hard to find.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[truezip-issues] [JIRA] Created: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

palich (JIRA) 06/06/2013

[truezip-issues] [JIRA] Commented: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

palich (JIRA) 06/06/2013

[truezip-issues] [JIRA] Updated: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

Christian Schlichtherle (JIRA) 06/06/2013

[truezip-issues] [JIRA] Updated: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

Christian Schlichtherle (JIRA) 06/06/2013

[truezip-issues] [JIRA] Commented: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

Christian Schlichtherle (JIRA) 06/07/2013

[truezip-issues] [JIRA] Commented: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

Christian Schlichtherle (JIRA) 06/13/2013

[truezip-issues] [JIRA] Commented: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

palich (JIRA) 06/20/2013

[truezip-issues] [JIRA] Updated: (TRUEZIP-321) TrueZip does not detect sub archives when Java's temp directory does not exist

Christian Schlichtherle (JIRA) 06/25/2013
 
 
Close
loading
Please Confirm
Close