Package org.springframework.core.io

Examples of org.springframework.core.io.ClassPathResource.contentLength()


  private static boolean isDirectoryByClasspath(String classpath) {
    classpath = classpath.trim();
    Resource resource = new ClassPathResource(classpath);
    if (resource.exists()) {
      try {
        return resource.contentLength() == 0;
      } catch (IOException e) {
        return false;
      }
    }
    try {
View Full Code Here


  public void test() throws Exception {
    Resource junit = new ClassPathResource("org/junit");
    logger.info(junit.exists() + "");
    logger.info(junit.isReadable() + "");
    logger.info(junit.isOpen() + "");
    logger.info(junit.contentLength() + "");

    Resource junitClass = new ClassPathResource("org/junit/Test.class");
    logger.info(junitClass.exists() + "");
    logger.info(junitClass.isReadable() + "");
    logger.info(junitClass.isOpen() + "");
View Full Code Here

    Resource junitClass = new ClassPathResource("org/junit/Test.class");
    logger.info(junitClass.exists() + "");
    logger.info(junitClass.isReadable() + "");
    logger.info(junitClass.isOpen() + "");
    logger.info(junitClass.contentLength() + "");

    logger.info(ResourceUtils.exists("abc/def") + "");
    logger.info(ResourceUtils.exists("abc/def.txt") + "");

    logger.info(ResourceUtils.exists("org/junit") + "");
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.