/** * Convert any locations representing an existing file into a fully qualified file system url. Leave any locations that do not resolve to an existing file alone. */ protected List<String> getConvertedLocations(List<String> locations) { List<String> converted = new ArrayList<String>(); for (String location : locations) { if (LocationUtils.isExistingFile(location)) { File file = new File(location); // ClassPathXmlApplicationContext needs a fully qualified URL, not a filename String url = LocationUtils.getCanonicalURLString(file); converted.add(url); } else { converted.add(location); } } return converted; }
/** * Convert any locations representing an existing file into a fully qualified file system url. Leave any locations that do not resolve to an existing file alone. */ protected List<String> getConvertedLocations(List<String> locations) { List<String> converted = new ArrayList<String>(); for (String location : locations) { if (LocationUtils.isExistingFile(location)) { File file = new File(location); // ClassPathXmlApplicationContext needs a fully qualified URL, not a filename String url = LocationUtils.getCanonicalURLString(file); converted.add(url); } else { converted.add(location); } } return converted; }
protected String getLocationURL(CanonicalFile resourceFile, MetaInfContext context) { if (!context.isRelativePaths()) { return LocationUtils.getCanonicalURLString(resourceFile); } else { return getRelativeLocationURL(resourceFile, context); } }
@Override public void copyFile(File source, RemoteFile destination) { Assert.notNull(source); Assert.isTrue(source.exists()); Assert.isTrue(!source.isDirectory()); Assert.isTrue(source.canRead()); copyLocationToFile(LocationUtils.getCanonicalURLString(source), destination); }
@Override public void copyFile(File source, RemoteFile destination) { Assert.notNull(source); Assert.isTrue(source.exists()); Assert.isTrue(!source.isDirectory()); Assert.isTrue(source.canRead()); copyLocationToFile(LocationUtils.getCanonicalURLString(source), destination); }
@Override public CopyResult scp(File source, RemoteFile destination) { Assert.notNull(source); Assert.exists(source); Assert.isFalse(source.isDirectory(), "[" + source + "] is a directory"); Assert.isTrue(source.canRead(), "[" + source + "] not readable"); return scp(LocationUtils.getCanonicalURLString(source), destination); }