Package org.crsh.vfs

Examples of org.crsh.vfs.FS


    } else {
      if (!root.isDirectory()) {
        throw new IllegalArgumentException("Wrong root directory argument " + root.getCanonicalPath());
      }
    }
    FS cmdFS = new FS().mount(Thread.currentThread().getContextClassLoader(), Path.get("/crash/commands/"));
    FS confFS = new FS().mount(Thread.currentThread().getContextClassLoader(), Path.get("/crash/"));
    PluginContext ctx = new PluginContext(
      new ServiceLoaderDiscovery(Thread.currentThread().getContextClassLoader()),
      Collections.<String, Object>emptyMap(),
      cmdFS,
      confFS,
View Full Code Here


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

    //
    FS cmdFS = new FS.Builder().register("file", fileDriver).register("classpath", classpathDriver).mount(cmd).build();
    FS confFS = new FS.Builder().register("file", fileDriver).register("classpath", classpathDriver).mount(conf).build();
    Bootstrap bootstrap = new Bootstrap(Thread.currentThread().getContextClassLoader(), confFS, cmdFS);

    //
    if (properties != null) {
      Properties config = new Properties();
View Full Code Here

   * @return the plugin context
   */
  protected PluginContext create(Map<String, Object> attributes, PluginDiscovery discovery, ClassLoader loader) {

    //
    FS cmdFS;
    FS confFS;
    try {
      cmdFS = createCommandFS();
      confFS = createConfFS();
    }
    catch (IOException e) {
View Full Code Here

      stop();
    }

    @PostConstruct
    public void init() {
      FS commandFileSystem = createFileSystem(
          this.properties.getCommandPathPatterns(),
          this.properties.getDisabledCommands());
      FS configurationFileSystem = createFileSystem(
          this.properties.getConfigPathPatterns(), new String[0]);

      PluginDiscovery discovery = new BeanFactoryFilteringPluginDiscovery(
          this.resourceLoader.getClassLoader(), this.beanFactory,
          this.properties.getDisabledPlugins());
View Full Code Here

    }

    protected FS createFileSystem(String[] pathPatterns, String[] filterPatterns) {
      Assert.notNull(pathPatterns, "PathPatterns must not be null");
      Assert.notNull(filterPatterns, "FilterPatterns must not be null");
      FS fileSystem = new FS();
      for (String pathPattern : pathPatterns) {
        try {
          fileSystem.mount(new SimpleFileSystemDriver(new DirectoryHandle(
              pathPattern, this.resourceLoader, filterPatterns)));
        }
        catch (IOException ex) {
          throw new IllegalStateException("Failed to mount file system for '"
              + pathPattern + "'", ex);
View Full Code Here

   *
   * @param baseLoader the base classloader crash will use
   * @throws NullPointerException if any argument is null
   */
  public Bootstrap(ClassLoader baseLoader) throws NullPointerException {
    this(baseLoader, new FS(), new FS());
  }
View Full Code Here

    this.attributes = new HashMap<String, Object>();
    this.commands = new RAMDriver();
    this.context = new PluginContext(
      discovery,
      attributes,
      new FS().mount(classLoader,Path.get("/crash/commands/")).mount(commands),
      new FS().mount(classLoader,Path.get("/crash/")),
      classLoader);
    this.crash = new CRaSH(context);
  }
View Full Code Here

TOP

Related Classes of org.crsh.vfs.FS

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.