@Override public Set<String> listWebAppPaths(String path) { path = validate(path); // Set because we don't want duplicates Set<String> result = new HashSet<>(); for (List<WebResourceSet> list : allResources) { for (WebResourceSet webResourceSet : list) { if (!webResourceSet.getClassLoaderOnly()) { result.addAll(webResourceSet.listWebAppPaths(path)); } } } if (result.size() == 0) { return null; } return result; }
@Override public Set<String> listWebAppPaths(String path) { path = validate(path); // Set because we don't want duplicates HashSet<String> result = new HashSet<>(); for (ArrayList<WebResourceSet> list : allResources) { for (WebResourceSet webResourceSet : list) { if (!webResourceSet.getClassLoaderOnly()) { result.addAll(webResourceSet.listWebAppPaths(path)); } } } if (result.size() == 0) { return null; } return result; }
private String[] list(String path, boolean validate) { if (validate) { path = validate(path); } // Set because we don't want duplicates // LinkedHashSet to retain the order. It is the order of the // WebResourceSet that matters but it is simpler to retain the order // over all of the JARs. HashSet<String> result = new LinkedHashSet<>(); for (List<WebResourceSet> list : allResources) { for (WebResourceSet webResourceSet : list) { if (!webResourceSet.getClassLoaderOnly()) { String[] entries = webResourceSet.list(path); for (String entry : entries) { result.add(entry); } } } } return result.toArray(new String[result.size()]); }
@Override public Set<String> listWebAppPaths(String path) { path = validate(path); // Set because we don't want duplicates Set<String> result = new HashSet<>(); for (List<WebResourceSet> list : allResources) { for (WebResourceSet webResourceSet : list) { if (!webResourceSet.getClassLoaderOnly()) { result.addAll(webResourceSet.listWebAppPaths(path)); } } } if (result.size() == 0) { return null; } return result; }
private String[] list(String path, boolean validate) { if (validate) { path = validate(path); } // Set because we don't want duplicates // LinkedHashSet to retain the order. It is the order of the // WebResourceSet that matters but it is simpler to retain the order // over all of the JARs. HashSet<String> result = new LinkedHashSet<>(); for (List<WebResourceSet> list : allResources) { for (WebResourceSet webResourceSet : list) { if (!webResourceSet.getClassLoaderOnly()) { String[] entries = webResourceSet.list(path); for (String entry : entries) { result.add(entry); } } } } return result.toArray(new String[result.size()]); }
@Override public boolean mkdir(String path) { path = validate(path); if (preResourceExists(path)) { return false; } return main.mkdir(path); }
@Override public boolean write(String path, InputStream is, boolean overwrite) { path = validate(path); if (!overwrite && preResourceExists(path)) { return false; } return main.write(path, is, overwrite); }
protected WebResource[] listResources(String path, boolean validate) { if (validate) { path = validate(path); } String[] resources = list(path, false); WebResource[] result = new WebResource[resources.length]; for (int i = 0; i < resources.length; i++) { if (path.charAt(path.length() - 1) == '/') { result[i] = getResource(path + resources[i], false, false); } else { result[i] = getResource(path + '/' + resources[i], false, false); } } return result; }
protected WebResource[] listResources(String path, boolean validate) { if (validate) { path = validate(path); } String[] resources = list(path, false); WebResource[] result = new WebResource[resources.length]; for (int i = 0; i < resources.length; i++) { if (path.charAt(path.length() - 1) == '/') { result[i] = getResource(path + resources[i], false, false); } else { result[i] = getResource(path + '/' + resources[i], false, false); } } return result; }
private WebResource[] listResources(String path, boolean validate) { if (validate) { path = validate(path); } String[] resources = list(path, false); WebResource[] result = new WebResource[resources.length]; for (int i = 0; i < resources.length; i++) { if (path.charAt(path.length() - 1) == '/') { result[i] = getResource(path + resources[i], false, false); } else { result[i] = getResource(path + '/' + resources[i], false, false); } } return result; }
private WebResource[] getResources(String path, boolean useClassLoaderResources) { path = validate(path); ArrayList<WebResource> result = new ArrayList<>(); for (ArrayList<WebResourceSet> list : allResources) { for (WebResourceSet webResourceSet : list) { if (useClassLoaderResources || !webResourceSet.getClassLoaderOnly()) { WebResource webResource = webResourceSet.getResource(path); if (webResource.exists()) { result.add(webResource); } } } } if (result.size() == 0) { result.add(main.getResource(path)); } return result.toArray(new WebResource[result.size()]); }
private WebResource getResource(String path, boolean validate, boolean useClassLoaderResources) { if (validate) { path = validate(path); } if (isCachingAllowed()) { return cache.getResource(path, useClassLoaderResources); } else { return getResourceInternal(path, useClassLoaderResources); } }
private WebResource[] getResources(String path, boolean useClassLoaderResources) { path = validate(path); if (isCachingAllowed()) { return cache.getResources(path, useClassLoaderResources); } else { return getResourcesInternal(path, useClassLoaderResources); } }
private WebResource[] getResources(String path, boolean useClassLoaderResources) { path = validate(path); if (isCachingAllowed()) { return cache.getResources(path, useClassLoaderResources); } else { return getResourcesInternal(path, useClassLoaderResources); } }
private WebResource getResource(String path, boolean validate, boolean useClassLoaderResources) { if (validate) { path = validate(path); } if (isCachingAllowed()) { return cache.getResource(path, useClassLoaderResources); } else { return getResourceInternal(path, useClassLoaderResources); } }
private WebResource getResource(String path, boolean validate, boolean useClassLoaderResources) { if (validate) { path = validate(path); } if (isCachingAllowed()) { return cache.getResource(path, useClassLoaderResources); } else { return getResourceInternal(path, useClassLoaderResources); } }
@Override public boolean write(String path, InputStream is, boolean overwrite) { path = validate(path); if (!overwrite && preResourceExists(path)) { return false; } boolean writeResult = main.write(path, is, overwrite); if (writeResult && isCachingAllowed()) { // Remove the entry from the cache so the new resource is visible cache.removeCacheEntry(path); } return writeResult; }
@Override public boolean mkdir(String path) { path = validate(path); if (preResourceExists(path)) { return false; } boolean mkdirResult = main.mkdir(path); if (mkdirResult && isCachingAllowed()) { // Remove the entry from the cache so the new directory is visible cache.removeCacheEntry(path); } return mkdirResult; }
@Override public boolean write(String path, InputStream is, boolean overwrite) { path = validate(path); if (!overwrite && preResourceExists(path)) { return false; } boolean writeResult = main.write(path, is, overwrite); if (writeResult && isCachingAllowed()) { // Remove the entry from the cache so the new resource is visible cache.removeCacheEntry(path); } return writeResult; }
@Override public boolean mkdir(String path) { path = validate(path); if (preResourceExists(path)) { return false; } boolean mkdirResult = main.mkdir(path); if (mkdirResult && isCachingAllowed()) { // Remove the entry from the cache so the new directory is visible cache.removeCacheEntry(path); } return mkdirResult; }