Package org.apache.wicket.util.file

Examples of org.apache.wicket.util.file.Path


   * Test locating a resource.
   */
  public void testLocate()
  {
    // Execute without source path
    executeMultiple(new Path());

    // Determine source path
    IResourceStreamLocator locator = new ResourceStreamLocator();
    IResourceStream resource = locator.locate(getClass(), this.getClass().getName().replace(
        '.', '/'), null, null, "txt");
    String path = getPath(resource);
    path = Strings.beforeLastPathComponent(path, '/') + "/sourcePath";

    // and execute
    executeMultiple(new Path(new Folder(path)));
  }
View Full Code Here


   * Test locating a resource.
   */
  public void testLocate()
  {
    // Execute without source path
    executeMultiple(new Path());

    // Determine source path
    IResourceStreamLocator locator = new ResourceStreamLocator();
    IResourceStream resource = locator.locate(getClass(), this.getClass().getName().replace(
      '.', '/'), null, null, null, "txt");
    String path = getPath(resource);
    path = Strings.beforeLastPathComponent(path, '/') + "/sourcePath";

    // and execute
    executeMultiple(new Path(new Folder(path)));
  }
View Full Code Here

   * Test locating a resource.
   */
  public void testLocate()
  {
    // Execute without source path
    executeMultiple(new Path());

    // Determine source path
    IResourceStreamLocator locator = new ResourceStreamLocator();
    IResourceStream resource = locator.locate(getClass(), this.getClass().getName().replace(
      '.', '/'), null, null, null, "txt");
    String path = getPath(resource);
    path = Strings.beforeLastPathComponent(path, '/') + "/sourcePath";

    // and execute
    executeMultiple(new Path(new Folder(path)));
  }
View Full Code Here

    {
      // Add optional sourceFolder for resources.
      String resourceFolder = getInitParameter("sourceFolder");
      if (resourceFolder != null)
      {
        getResourceSettings().getResourceFinders().add(new Path(resourceFolder));
      }
    }
    setPageRendererProvider(new WebPageRendererProvider());
    setSessionStoreProvider(new WebSessionStoreProvider());
    setAjaxRequestTargetProvider(new DefaultAjaxRequestTargetProvider());
View Full Code Here

    {
      // Add optional sourceFolder for resources.
      String resourceFolder = getInitParameter("sourceFolder");
      if (resourceFolder != null)
      {
        getResourceSettings().getResourceFinders().add(new Path(resourceFolder));
      }
    }
    setPageRendererProvider(new WebPageRendererProvider());
    setSessionStoreProvider(new WebSessionStoreProvider());
    setAjaxRequestTargetProvider(new DefaultAjaxRequestTargetProvider());
View Full Code Here

  public void loadFromRootUsingSubpathInFilename() throws Exception
  {
    final String contents = PathTest.class.getName() + ": loaded from root";
    final File file = createTempFile(contents);
    final File root = findRoot(file);
    final Path path = new Path(root.getCanonicalPath());
    String relative = root.toURI().relativize(file.toURI()).getPath();
    IResourceStream rs = path.find(PathTest.class, relative);
    assertNotNull(rs);
    assertContents(contents, rs);
  }
View Full Code Here

  public void loadFilenameFromPath() throws Exception
  {
    final String contents = PathTest.class.getName() + ": loaded from prefix";
    final File file = createTempFile(contents);
    final File parent = file.getParentFile();
    final Path path = new Path(parent.getCanonicalPath());
    IResourceStream rs = path.find(PathTest.class, file.getName());
    assertNotNull(rs);
    assertContents(contents, rs);
  }
View Full Code Here

    {
      // Add optional sourceFolder for resources.
      String resourceFolder = getInitParameter("sourceFolder");
      if (resourceFolder != null)
      {
        getResourceSettings().getResourceFinders().add(new Path(resourceFolder));
      }
    }
    setPageRendererProvider(new WebPageRendererProvider());
    setSessionStoreProvider(new WebSessionStoreProvider());
    setAjaxRequestTargetProvider(new DefaultAjaxRequestTargetProvider());
View Full Code Here

  public void loadFromRootUsingSubpathInFilename() throws Exception
  {
    final String contents = PathTest.class.getName() + ": loaded from root";
    final File file = createTempFile(contents);
    final File root = findRoot(file);
    final Path path = new Path(root.getCanonicalPath());
    IResourceStream rs = path.find(PathTest.class, file.getCanonicalPath());
    assertNotNull(rs);
    assertContents(contents, rs);
  }
View Full Code Here

  public void loadFilenameFromPath() throws Exception
  {
    final String contents = PathTest.class.getName() + ": loaded from prefix";
    final File file = createTempFile(contents);
    final File parent = file.getParentFile();
    final Path path = new Path(parent.getCanonicalPath());
    IResourceStream rs = path.find(PathTest.class, file.getName());
    assertNotNull(rs);
    assertContents(contents, rs);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.file.Path

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.