All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gw.config.DefaultExtensionFolderLocator Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
/*
 * Copyright 2014 Guidewire Software, Inc.
 */

package gw.config;

import java.io.File;
import java.net.URL;

public class DefaultExtensionFolderLocator extends BaseService implements IExtensionFolderLocator {

  @Override
  public File getExtensionFolderPath() {
    try {
      URL loc = Class.forName( "gw.NativeLibraryLocationMarker" ).getProtectionDomain().getCodeSource().getLocation();
      if (loc == null) {
        return null;
      }
      File path = new File(new File(loc.getPath()).getParentFile().getParentFile(), "ext");
      return path;
    } catch (ClassNotFoundException e) {
      System.err.println("Cannot locate native-library-marker.jar.");
      return null;
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy