import java.io.IOException;
import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Map;
+import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
Session session = repository.login(new SimpleCredentials(username, username.toCharArray()));
fileSystem = new JcrFileSystem(this, session);
return fileSystem;
- } catch (Exception e) {
- throw new JcrFsException("Cannot login to repository", e);
+ } catch (RepositoryException | URISyntaxException e) {
+ throw new IOException("Cannot login to repository", e);
}
}
@Override
public Path getPath(URI uri) {
String path = uri.getPath();
- if(fileSystem==null)
+ if (fileSystem == null)
try {
newFileSystem(uri, new HashMap<String, Object>());
} catch (IOException e) {
- throw new JcrFsException("Could not autocreate file system",e);
+ throw new JcrFsException("Could not autocreate file system", e);
}
return fileSystem.getPath(path);
}