コード例 #1
0
  /** Constructor for testing purposes. Takes a repository as a parameter. */
  public OlapServiceImpl(IUnifiedRepository repo, final MondrianServer server) {
    this.repository = repo;
    this.filters = new CopyOnWriteArrayList<IOlapConnectionFilter>();
    this.server = server;

    try {
      DefaultFileSystemManager dfsm = (DefaultFileSystemManager) VFS.getManager();
      if (dfsm.hasProvider("mondrian") == false) {
        dfsm.addProvider("mondrian", new MondrianVfs());
      }
    } catch (FileSystemException e) {
      throw new RuntimeException(e);
    }
  }
コード例 #2
0
  @Test
  public void test() throws FileSystemException, URISyntaxException {
    DefaultFileSystemManager fsm = new DefaultFileSystemManager();
    fsm.setDefaultProvider(new UrlFileProvider());
    fsm.addProvider("file", new DefaultLocalFileProvider());
    fsm.addProvider("jar", new FastJarFileProvider());
    fsm.init();

    String jarUri = getClass().getResource("/jarfiletest.jar").toURI().toString();
    FileObject object = fsm.resolveFile("jar:" + jarUri + "!/r/");

    assertThat(object.exists(), equalTo(true));
    assertThat(object.getType(), equalTo(FileType.FOLDER));

    FileObject[] children = object.getChildren();
    assertThat(children.length, equalTo(1));
    assertThat(children[0].getName().getBaseName(), equalTo("library"));
    assertThat(children[0].getType(), equalTo(FileType.FOLDER));

    object = fsm.resolveFile("jar:" + jarUri + "!/r/library/survey");

    assertThat(object.getType(), equalTo(FileType.FOLDER));
    assertThat(object.getChildren().length, equalTo(4));
  }
コード例 #3
0
 /** Prepares the file system manager. This implementation does nothing. */
 @Override
 public void prepare(final DefaultFileSystemManager manager) throws Exception {
   manager.addProvider("http", new UrlFileProvider());
 }