@ -503,6 +503,9 @@ public class HadoopUtils implements Closeable {
* @return hdfs file name
* @return hdfs file name
* /
* /
public static String getHdfsFileName ( ResourceType resourceType , String tenantCode , String fileName ) {
public static String getHdfsFileName ( ResourceType resourceType , String tenantCode , String fileName ) {
if ( fileName . startsWith ( "/" ) ) {
fileName = fileName . replaceFirst ( "/" , "" ) ;
}
return String . format ( "%s/%s" , getHdfsDir ( resourceType , tenantCode ) , fileName ) ;
return String . format ( "%s/%s" , getHdfsDir ( resourceType , tenantCode ) , fileName ) ;
}
}
@ -514,6 +517,9 @@ public class HadoopUtils implements Closeable {
* @return get absolute path and name for file on hdfs
* @return get absolute path and name for file on hdfs
* /
* /
public static String getHdfsResourceFileName ( String tenantCode , String fileName ) {
public static String getHdfsResourceFileName ( String tenantCode , String fileName ) {
if ( fileName . startsWith ( "/" ) ) {
fileName = fileName . replaceFirst ( "/" , "" ) ;
}
return String . format ( "%s/%s" , getHdfsResDir ( tenantCode ) , fileName ) ;
return String . format ( "%s/%s" , getHdfsResDir ( tenantCode ) , fileName ) ;
}
}
@ -525,6 +531,9 @@ public class HadoopUtils implements Closeable {
* @return get absolute path and name for udf file on hdfs
* @return get absolute path and name for udf file on hdfs
* /
* /
public static String getHdfsUdfFileName ( String tenantCode , String fileName ) {
public static String getHdfsUdfFileName ( String tenantCode , String fileName ) {
if ( fileName . startsWith ( "/" ) ) {
fileName = fileName . replaceFirst ( "/" , "" ) ;
}
return String . format ( "%s/%s" , getHdfsUdfDir ( tenantCode ) , fileName ) ;
return String . format ( "%s/%s" , getHdfsUdfDir ( tenantCode ) , fileName ) ;
}
}