import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.HashMap;

public class JI9028389 {

	public static void main(String[] args) throws Exception {
		URI uri = new URI("jar:file:/C:/temp/smallzip.zip"); 
		FileSystem fileSystem = FileSystems.newFileSystem(uri, new HashMap<String, Object>()); 
		Path path = fileSystem.getPath("/tmp/path"); 
		Path pathWithSlash = fileSystem.getPath("/tmp/path/"); 

		Path textFilePath = fileSystem.getPath("/tmp/path/text.txt"); 
		Path relativized = path.relativize(textFilePath); 
		Path relativized1 = pathWithSlash.relativize(textFilePath); 

		System.out.println("relativized: " + relativized); 
		System.out.println("relativized1: " + relativized1); 

	}

}
