Package org.apache.wicket.util.file

Examples of org.apache.wicket.util.file.Path.find()


    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);
  }

  public static void assertContents(String expectedContents, IResourceStream rs)
View Full Code Here


  {
    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);
  }

  public static File createTempFile(String contents) throws IOException
View Full Code Here

  {
    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);
  }

  public static void assertContents(String expectedContents, IResourceStream rs)
View Full Code Here

  {
    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);
  }

  public static File createTempFile(String contents) throws IOException
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.