本文整理匯總了Java中org.apache.hadoop.fs.Path.mergePaths方法的典型用法代碼示例。如果您正苦於以下問題:Java Path.mergePaths方法的具體用法?Java Path.mergePaths怎麽用?Java Path.mergePaths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.fs.Path
的用法示例。
在下文中一共展示了Path.mergePaths方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: formPath
import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
private Path formPath(String dirOrFile1, String dirOrFile2)
{
String base = config.getMetaserverStore();
String path1 = dirOrFile1;
String path2 = dirOrFile2;
while (base.endsWith("/")) {
base = base.substring(0, base.length() - 2);
}
if (!path1.startsWith("/")) {
path1 = "/" + path1;
}
if (path1.endsWith("/")) {
path1 = path1.substring(0, path1.length() - 2);
}
if (!path2.startsWith("/")) {
path2 = "/" + path2;
}
return Path.mergePaths(Path.mergePaths(new Path(base), new Path(path1)), new Path(path2));
}
示例2: formPath
import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
private Path formPath(String dirOrFile)
{
String base = config.getHDFSWarehouse();
String path = dirOrFile;
while (base.endsWith("/")) {
base = base.substring(0, base.length() - 2);
}
if (!path.startsWith("/")) {
path = "/" + path;
}
return Path.mergePaths(new Path(base), new Path(path));
}
示例3: addPrefix
import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
protected Path addPrefix(Path path) {
return Path.mergePaths(new Path(PATH_PREFIX), path);
}
示例4: createWithFullSchema
import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
public static FileSelection createWithFullSchema(final FileSystemWrapper fs, final String parent, final String fullSchemaPath) throws IOException {
final Path combined = Path.mergePaths(new Path(parent), PathUtils.toFSPath(fullSchemaPath));
return create(fs, combined);
}
示例5: getUploadLocation
import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
private Path getUploadLocation(FilePath filePath, String extension) {
FilePath filePathWithExtension = filePath.rename(format("%s_%s", filePath.getFileName().getName(), extension));
return Path.mergePaths(config.getUploadsDir(), PathUtils.toFSPath(filePathWithExtension.toPathList()));
}
示例6: getStagingLocation
import org.apache.hadoop.fs.Path; //導入方法依賴的package包/類
/**
* Temporary location for file upload.
* Add uuid so that this location remains unique even across file renames.
* @param filePath file path in under home space
* @param extension file extension
* @return location of staging dir where user file is uploaded.
*/
private Path getStagingLocation(FilePath filePath, String extension) {
FilePath uniquePath = filePath.rename(format("%s_%s-%s", filePath.getFileName().toString(), extension, UUID.randomUUID().toString()));
return Path.mergePaths(config.getStagingDir(), PathUtils.toFSPath(uniquePath.toPathList()));
}