- diff --git a/src/main/java/org/dcache/vfs4j/NfsMain.java b/src/main/java/org/dcache/vfs4j/NfsMain.java
- index ef914d6..f3160a5 100644
- --- a/src/main/java/org/dcache/vfs4j/NfsMain.java
- +++ b/src/main/java/org/dcache/vfs4j/NfsMain.java
- @@ -73,11 +73,24 @@ public class NfsMain implements Callable<Void> {
- defaultValue = "true")
- private boolean withV4;
- - @CommandLine.Parameters(index = "0", description = "directory to export")
- - private File dir;
- + @CommandLine.Option(
- + names = {"--port"},
- + description = "NFS port number (default 2049)",
- + showDefaultValue = CommandLine.Help.Visibility.ALWAYS,
- + defaultValue = "2049")
- + private int nfsPort;
- - @CommandLine.Parameters(index = "1", description = "path to export file")
- - private File export;
- + @CommandLine.Option(
- + names = "--root",
- + description = "root directory for exports",
- + defaultValue = "/")
- + private File nfsRootDir;
- +
- + @CommandLine.Option(
- + names = "--exports",
- + description = "paths to exports file",
- + defaultValue = "")
- + private File exportsFile;
- public static void main(String[] args) throws Exception {
- new CommandLine(new NfsMain()).setNegatableOptionTransformer(
- @@ -93,25 +106,32 @@ public class NfsMain implements Callable<Void> {
- SSLParameters sslParameters = null;
- SSLContext sslContext = null;
- +
- + System.out.println("# start.");
- + System.out.println("# config: nfsRootDir=" + nfsRootDir.toString() +
- + " exportsFile=" + exportsFile.toString() +
- + " port=" + nfsPort + ".");
- +
- if (tls) {
- sslContext = TLSUtils.createSslContext(cert, key, new char[0], chain, insecure);
- sslParameters = sslContext.getDefaultSSLParameters();
- sslParameters.setNeedClientAuth(mutual);
- }
- - VirtualFileSystem vfs = new LocalVFS(dir);
- + VirtualFileSystem vfs = new LocalVFS(nfsRootDir);
- OncRpcSvc nfsSvc =
- new OncRpcSvcBuilder()
- - .withPort(2049)
- + .withPort(this.nfsPort)
- .withTCP()
- .withAutoPublish()
- .withWorkerThreadIoStrategy()
- .withStartTLS()
- - .withSSLContext(sslContext)
- - .withSSLParameters(sslParameters)
- +// .withSSLContext(sslContext)
- +// .withSSLParameters(sslParameters)
- +// .withServiceName("nfs@"+this.nfsPort)
- .build();
- - ExportTable exportFile = new ExportFile(export);
- + ExportTable exportFile = new ExportFile(exportsFile);
- if (withV4) {
- NFSServerV41 nfs4 =
vfs4j port path prototype, not functional yet
Posted by Anonymous on Thu 18th Jan 2024 06:50
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.