// Path: src/main/java/com/google/dicomwebfuse/exception/DicomFuseException.java
// public class DicomFuseException extends Exception {
// 
//   private int statusCode;
// 
//   public DicomFuseException(String message) {
//     super(message);
//   }
// 
//   public DicomFuseException(String message, Exception e) {
//     super(message, e);
//   }
// 
//   public DicomFuseException(Exception e) {
//     super(e);
//   }
// 
//   public DicomFuseException(String message, int statusCode) {
//     super(message);
//     this.statusCode = statusCode;
//   }
// 
//   public int getStatusCode() {
//     return statusCode;
//   }
// }
// 
// Path: src/main/java/com/google/dicomwebfuse/parser/Arguments.java
// public class Arguments {
// 
//   @Parameter(
//       names = {"--datasetAddr", "-a"},
//       descriptionKey = "option.datasetAddr",
//       required = true,
//       order = 0,
//       converter = CloudConfigurationConverter.class
//   )
//   public CloudConf cloudConf;
// 
//   @Parameter(
//       names = {"--mountPath", "-p"},
//       descriptionKey = "option.mountPath",
//       required = true,
//       order = 1,
//       converter = PathConverter.class
//   )
//   public Path mountPath;
// 
//   @Parameter(
//       names = {"--cacheTime", "-t"},
//       descriptionKey = "option.cacheTime",
//       converter = CacheTimeConverter.class,
//       order = 2,
//       validateWith = CacheTimePositiveValidator.class
//   )
//   public CacheTime cacheTime = new CacheTime(60, 300);
// 
//   @Parameter(
//       names = {"--cacheSize", "-s"},
//       descriptionKey = "option.cacheSize",
//       converter = LongConverter.class,
//       order = 3,
//       validateWith = CacheSizePositiveValidator.class
//   )
//   public long cacheSize = 10000;
// 
//   @Parameter(
//       names = {"--enableDeletion", "-d"},
//       descriptionKey = "option.enableDeletion",
//       order = 4,
//       converter = BooleanConverter.class
//   )
//   public boolean enableDeletion = true;
// 
//   @Parameter(
//       names = {"--keyFile", "-k"},
//       descriptionKey = "option.keyFile",
//       order = 5,
//       converter = PathConverter.class
//   )
//   public Path keyPath;
// 
//   @Parameter(
//       names = {"--extraMountOptions"},
//       descriptionKey = "option.extraMountOptions",
//       order = 6
//   )
//   public List<String> extraMountOptions = new ArrayList<>();
// 
//   @Parameter(
//       names = {"--help", "-h"},
//       help = true,
//       descriptionKey = "option.help",
//       order = 7
//   )
//   public boolean help = false;
// }


import com.beust.jcommander.JCommander;
import com.google.dicomwebfuse.exception.DicomFuseException;
import com.google.dicomwebfuse.parser.Arguments;
import java.io.IOException;
import java.util.ResourceBundle;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.dicomwebfuse;


public class App {

  private static final Logger LOGGER = LogManager.getLogger();

  public static void main(String[] args) {

    Arguments arguments = new Arguments();
    JCommander jCommander = JCommander.newBuilder()
        .addObject(arguments)
        .resourceBundle(ResourceBundle.getBundle("cli-messages"))
        .programName("DICOMFuse")
        .build();
    jCommander.parse(args);

    if (arguments.help) {
      jCommander.usage();
      return;
    }

    try {
      AppMountProcess appMountProcess = new AppMountProcess(arguments);
      appMountProcess.startMountProcess();
// Path: src/main/java/com/google/dicomwebfuse/exception/DicomFuseException.java
// public class DicomFuseException extends Exception {
// 
//   private int statusCode;
// 
//   public DicomFuseException(String message) {
//     super(message);
//   }
// 
//   public DicomFuseException(String message, Exception e) {
//     super(message, e);
//   }
// 
//   public DicomFuseException(Exception e) {
//     super(e);
//   }
// 
//   public DicomFuseException(String message, int statusCode) {
//     super(message);
//     this.statusCode = statusCode;
//   }
// 
//   public int getStatusCode() {
//     return statusCode;
//   }
// }
// 
// Path: src/main/java/com/google/dicomwebfuse/parser/Arguments.java
// public class Arguments {
// 
//   @Parameter(
//       names = {"--datasetAddr", "-a"},
//       descriptionKey = "option.datasetAddr",
//       required = true,
//       order = 0,
//       converter = CloudConfigurationConverter.class
//   )
//   public CloudConf cloudConf;
// 
//   @Parameter(
//       names = {"--mountPath", "-p"},
//       descriptionKey = "option.mountPath",
//       required = true,
//       order = 1,
//       converter = PathConverter.class
//   )
//   public Path mountPath;
// 
//   @Parameter(
//       names = {"--cacheTime", "-t"},
//       descriptionKey = "option.cacheTime",
//       converter = CacheTimeConverter.class,
//       order = 2,
//       validateWith = CacheTimePositiveValidator.class
//   )
//   public CacheTime cacheTime = new CacheTime(60, 300);
// 
//   @Parameter(
//       names = {"--cacheSize", "-s"},
//       descriptionKey = "option.cacheSize",
//       converter = LongConverter.class,
//       order = 3,
//       validateWith = CacheSizePositiveValidator.class
//   )
//   public long cacheSize = 10000;
// 
//   @Parameter(
//       names = {"--enableDeletion", "-d"},
//       descriptionKey = "option.enableDeletion",
//       order = 4,
//       converter = BooleanConverter.class
//   )
//   public boolean enableDeletion = true;
// 
//   @Parameter(
//       names = {"--keyFile", "-k"},
//       descriptionKey = "option.keyFile",
//       order = 5,
//       converter = PathConverter.class
//   )
//   public Path keyPath;
// 
//   @Parameter(
//       names = {"--extraMountOptions"},
//       descriptionKey = "option.extraMountOptions",
//       order = 6
//   )
//   public List<String> extraMountOptions = new ArrayList<>();
// 
//   @Parameter(
//       names = {"--help", "-h"},
//       help = true,
//       descriptionKey = "option.help",
//       order = 7
//   )
//   public boolean help = false;
// }


// Path: src/main/java/com/google/dicomwebfuse/App.java
import com.beust.jcommander.JCommander;
import com.google.dicomwebfuse.exception.DicomFuseException;
import com.google.dicomwebfuse.parser.Arguments;
import java.io.IOException;
import java.util.ResourceBundle;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.dicomwebfuse;


public class App {

  private static final Logger LOGGER = LogManager.getLogger();

  public static void main(String[] args) {

    Arguments arguments = new Arguments();
    JCommander jCommander = JCommander.newBuilder()
        .addObject(arguments)
        .resourceBundle(ResourceBundle.getBundle("cli-messages"))
        .programName("DICOMFuse")
        .build();
    jCommander.parse(args);

    if (arguments.help) {
      jCommander.usage();
      return;
    }

    try {
      AppMountProcess appMountProcess = new AppMountProcess(arguments);
      appMountProcess.startMountProcess();
    } catch (IOException | DicomFuseException e) {