Package org.springframework.core.io

Examples of org.springframework.core.io.Resource.lastModified()


    public final long getLastModified(org.apache.velocity.runtime.resource.Resource templateResource) {
        Resource resource = getResource(templateResource.getName());

        if (resource != null && resource.exists()) {
            try {
                return resource.lastModified();
            } catch (IOException e) {
            }
        }

        return 0;
View Full Code Here


        }

        long lastModified;

        try {
            lastModified = resource.lastModified();
        } catch (IOException e) {
            lastModified = 0;
        }

        // 2. ������Դ�ҵ��ˣ����Dz�֧��lastModified���ܣ�����Ϊmodified==false��ģ�岻������װ�ء�
View Full Code Here

    public final long getLastModified(org.apache.velocity.runtime.resource.Resource templateResource) {
        Resource resource = getResource(templateResource.getName());

        if (resource != null && resource.exists()) {
            try {
                return resource.lastModified();
            } catch (IOException e) {
            }
        }

        return 0;
View Full Code Here

    if (!systemPackageCache.isFile()) {
      return false;
    }
    final Resource libDir = resourcePatternResolver.getResource("/WEB-INF/lib");
    try {
      final boolean stale = libDir.lastModified() > systemPackageCache.lastModified();
      if (stale) {
        logger.info("system package cache is older then WEB-INF/lib, rescan packages");
      }
      return !stale;
    } catch (IOException e) {
View Full Code Here

  }

  // check last modified
  public void testLastModifiedWhileUsingJustTheOSGiAPI() throws Exception {
    Resource resource = patternLoader.getResource("osgibundlejar:/org/springframework/osgi/iandt/io/duplicate.file");
    assertTrue(resource.lastModified() > 0);
  }

  // wild pattern matching
  public void testResourcesFromWildCardWithAndWithoutLeadingSlash() throws Exception {
    Resource[] res = patternLoader.getResources("osgibundlejar:**/*");
 
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.