src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java
Print this page
*** 97,107 ****
{
Path path = uriToPath(uri);
synchronized(filesystems) {
Path realPath = null;
if (ensureFile(path)) {
! realPath = path.toRealPath(true);
if (filesystems.containsKey(realPath))
throw new FileSystemAlreadyExistsException();
}
ZipFileSystem zipfs = null;
try {
--- 97,107 ----
{
Path path = uriToPath(uri);
synchronized(filesystems) {
Path realPath = null;
if (ensureFile(path)) {
! realPath = path.toRealPath();
if (filesystems.containsKey(realPath))
throw new FileSystemAlreadyExistsException();
}
ZipFileSystem zipfs = null;
try {
*** 152,162 ****
@Override
public FileSystem getFileSystem(URI uri) {
synchronized (filesystems) {
ZipFileSystem zipfs = null;
try {
! zipfs = filesystems.get(uriToPath(uri).toRealPath(true));
} catch (IOException x) {
// ignore the ioe from toRealPath(), return FSNFE
}
if (zipfs == null)
throw new FileSystemNotFoundException();
--- 152,162 ----
@Override
public FileSystem getFileSystem(URI uri) {
synchronized (filesystems) {
ZipFileSystem zipfs = null;
try {
! zipfs = filesystems.get(uriToPath(uri).toRealPath());
} catch (IOException x) {
// ignore the ioe from toRealPath(), return FSNFE
}
if (zipfs == null)
throw new FileSystemNotFoundException();
*** 308,318 ****
}
//////////////////////////////////////////////////////////////
void removeFileSystem(Path zfpath, ZipFileSystem zfs) throws IOException {
synchronized (filesystems) {
! zfpath = zfpath.toRealPath(true);
if (filesystems.get(zfpath) == zfs)
filesystems.remove(zfpath);
}
}
}
--- 308,318 ----
}
//////////////////////////////////////////////////////////////
void removeFileSystem(Path zfpath, ZipFileSystem zfs) throws IOException {
synchronized (filesystems) {
! zfpath = zfpath.toRealPath();
if (filesystems.get(zfpath) == zfs)
filesystems.remove(zfpath);
}
}
}