Created
April 13, 2015 22:51
-
-
Save fge/c0801a33a67764368978 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.fge; | |
import com.github.marschall.memoryfilesystem.MemoryFileSystemBuilder; | |
import org.testng.annotations.AfterMethod; | |
import org.testng.annotations.BeforeMethod; | |
import java.io.IOException; | |
import java.net.URI; | |
import java.nio.file.FileSystem; | |
import java.nio.file.FileSystems; | |
import java.nio.file.Path; | |
import java.util.Collections; | |
import java.util.Map; | |
public final class ZipsTest | |
{ | |
private FileSystem fs; | |
private Path existingZip; | |
private Path nonExistingZip; | |
@BeforeMethod | |
public void init() | |
throws IOException | |
{ | |
fs = MemoryFileSystemBuilder.newLinux().build("zipstest"); | |
existingZip = fs.getPath("/existing.zip"); | |
nonExistingZip = fs.getPath("/nonexisting.zip"); | |
final URI uri = URI.create("jar:" + existingZip); | |
final Map<String, ?> env = Collections.singletonMap("create", "true"); | |
try ( | |
final FileSystem tmp = FileSystems.newFileSystem(uri, env); | |
) { | |
} | |
} | |
@AfterMethod | |
public void closefs() | |
throws IOException | |
{ | |
fs.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment