org.crsh.util.Utils.getCurrentDirectory()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中org.crsh.util.Utils.getCurrentDirectory()方法的一些代码示例,展示了Utils.getCurrentDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getCurrentDirectory()方法的具体详情如下:
包路径:org.crsh.util.Utils
类名称:Utils
方法名:getCurrentDirectory

Utils.getCurrentDirectory介绍

暂无

代码示例

代码示例来源:origin: crashub/crash

public void afterPropertiesSet() throws Exception {
 // Initialise the registerable drivers
 try {
  drivers.put("classpath", new ClassPathMountFactory(loader));
  drivers.put("file", new FileMountFactory(Utils.getCurrentDirectory()));
 }
 catch (Exception e) {
  log.log(Level.SEVERE, "Coult not initialize classpath driver", e);
  return;
 }
 // List beans
 Map<String,Object> attributes = new HashMap<String, Object>();
 attributes.put("factory", factory);
 if (factory instanceof ListableBeanFactory) {
  ListableBeanFactory listable = (ListableBeanFactory)factory;
  attributes.put("beans", new SpringMap(listable));
 }
 //
 PluginDiscovery discovery = new SpringPluginDiscovery(loader, factory);
 //
 start(Collections.unmodifiableMap(attributes), discovery, loader);
}

代码示例来源:origin: crashub/crash

private FS.Builder createBuilder() throws IOException {
 FileMountFactory fileDriver = new FileMountFactory(Utils.getCurrentDirectory());
 ClassPathMountFactory classpathDriver = new ClassPathMountFactory(Thread.currentThread().getContextClassLoader());
 return new FS.Builder().register("file", fileDriver).register("classpath", classpathDriver);
}

代码示例来源:origin: crashub/crash

public void contextInitialized(ServletContextEvent sce) {
 context = sce.getServletContext();
 // Use JVM properties as external config
 setConfig(System.getProperties());
 // Initialise the registerable drivers
 try {
  mountContexts.put("classpath", new ClassPathMountFactory(context.getClassLoader()));
  mountContexts.put("file", new FileMountFactory(Utils.getCurrentDirectory()));
  mountContexts.put("war", new WarMountFactory(context));
 }
 catch (Exception e) {
  log.log(Level.SEVERE, "Coult not initialize classpath driver", e);
  return;
 }
 //
 String contextPath = context.getContextPath();
 synchronized (lock) {
  if (!contextMap.containsKey(contextPath)) {
   ClassLoader webAppLoader = Thread.currentThread().getContextClassLoader();
   PluginDiscovery discovery = createDiscovery(context, webAppLoader);
   PluginContext pluginContext = start(new ServletContextMap(context), discovery, context.getClassLoader());
   contextMap.put(contextPath, pluginContext);
   registered = true;
  }
 }
}

代码示例来源:origin: crashub/crash

FileMountFactory fileDriver = new FileMountFactory(Utils.getCurrentDirectory());
ClassPathMountFactory classpathDriver = new ClassPathMountFactory(Thread.currentThread().getContextClassLoader());

代码示例来源:origin: org.crashub/crash.embed.spring

public void afterPropertiesSet() throws Exception {
 // Initialise the registerable drivers
 try {
  drivers.put("classpath", new ClassPathMountFactory(loader));
  drivers.put("file", new FileMountFactory(Utils.getCurrentDirectory()));
 }
 catch (Exception e) {
  log.log(Level.SEVERE, "Coult not initialize classpath driver", e);
  return;
 }
 // List beans
 Map<String,Object> attributes = new HashMap<String, Object>();
 attributes.put("factory", factory);
 if (factory instanceof ListableBeanFactory) {
  ListableBeanFactory listable = (ListableBeanFactory)factory;
  attributes.put("beans", new SpringMap(listable));
 }
 //
 PluginDiscovery discovery = new SpringPluginDiscovery(loader, factory);
 //
 start(Collections.unmodifiableMap(attributes), discovery, loader);
}

代码示例来源:origin: org.crashub/crash.shell

private FS.Builder createBuilder() throws IOException {
 FileMountFactory fileDriver = new FileMountFactory(Utils.getCurrentDirectory());
 ClassPathMountFactory classpathDriver = new ClassPathMountFactory(Thread.currentThread().getContextClassLoader());
 return new FS.Builder().register("file", fileDriver).register("classpath", classpathDriver);
}

代码示例来源:origin: com.github.corda.crash/crash.shell

private FS.Builder createBuilder() throws IOException {
 FileMountFactory fileDriver = new FileMountFactory(Utils.getCurrentDirectory());
 ClassPathMountFactory classpathDriver = new ClassPathMountFactory(Thread.currentThread().getContextClassLoader());
 return new FS.Builder().register("file", fileDriver).register("classpath", classpathDriver);
}

代码示例来源:origin: com.github.corda.crash/crash.shell

public void contextInitialized(ServletContextEvent sce) {
 context = sce.getServletContext();
 // Use JVM properties as external config
 setConfig(System.getProperties());
 // Initialise the registerable drivers
 try {
  mountContexts.put("classpath", new ClassPathMountFactory(context.getClassLoader()));
  mountContexts.put("file", new FileMountFactory(Utils.getCurrentDirectory()));
  mountContexts.put("war", new WarMountFactory(context));
 }
 catch (Exception e) {
  log.log(Level.SEVERE, "Coult not initialize classpath driver", e);
  return;
 }
 //
 String contextPath = context.getContextPath();
 synchronized (lock) {
  if (!contextMap.containsKey(contextPath)) {
   ClassLoader webAppLoader = Thread.currentThread().getContextClassLoader();
   PluginDiscovery discovery = createDiscovery(context, webAppLoader);
   PluginContext pluginContext = start(new ServletContextMap(context), discovery, context.getClassLoader());
   contextMap.put(contextPath, pluginContext);
   registered = true;
  }
 }
}

代码示例来源:origin: org.crashub/crash.shell

public void contextInitialized(ServletContextEvent sce) {
 context = sce.getServletContext();
 // Use JVM properties as external config
 setConfig(System.getProperties());
 // Initialise the registerable drivers
 try {
  mountContexts.put("classpath", new ClassPathMountFactory(context.getClassLoader()));
  mountContexts.put("file", new FileMountFactory(Utils.getCurrentDirectory()));
  mountContexts.put("war", new WarMountFactory(context));
 }
 catch (Exception e) {
  log.log(Level.SEVERE, "Coult not initialize classpath driver", e);
  return;
 }
 //
 String contextPath = context.getContextPath();
 synchronized (lock) {
  if (!contextMap.containsKey(contextPath)) {
   ClassLoader webAppLoader = Thread.currentThread().getContextClassLoader();
   PluginDiscovery discovery = createDiscovery(context, webAppLoader);
   PluginContext pluginContext = start(new ServletContextMap(context), discovery, context.getClassLoader());
   contextMap.put(contextPath, pluginContext);
   registered = true;
  }
 }
}

代码示例来源:origin: org.crashub/crash.shell

FileMountFactory fileDriver = new FileMountFactory(Utils.getCurrentDirectory());
ClassPathMountFactory classpathDriver = new ClassPathMountFactory(Thread.currentThread().getContextClassLoader());

代码示例来源:origin: com.github.corda.crash/crash.shell

FileMountFactory fileDriver = new FileMountFactory(Utils.getCurrentDirectory());
ClassPathMountFactory classpathDriver = new ClassPathMountFactory(Thread.currentThread().getContextClassLoader());

相关文章