本文整理匯總了Java中org.apache.hadoop.util.Shell.MAC屬性的典型用法代碼示例。如果您正苦於以下問題:Java Shell.MAC屬性的具體用法?Java Shell.MAC怎麽用?Java Shell.MAC使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.hadoop.util.Shell
的用法示例。
在下文中一共展示了Shell.MAC屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getExecString
@Override
protected String[] getExecString() {
String derefFlag = "-";
if (dereference) {
derefFlag = "-L";
}
if (Shell.LINUX) {
return new String[] {
"stat", derefFlag + "c", "%s,%F,%Y,%X,%a,%U,%G,%N", path.toString() };
} else if (Shell.FREEBSD || Shell.MAC) {
return new String[] {
"stat", derefFlag + "f", "%z,%HT,%m,%a,%Op,%Su,%Sg,`link' -> `%Y'",
path.toString() };
} else {
throw new UnsupportedOperationException(
"stat is not supported on this platform");
}
}
示例2: isAvailable
/**
* Whether Stat is supported on the current platform
* @return
*/
public static boolean isAvailable() {
if (Shell.LINUX || Shell.FREEBSD || Shell.MAC) {
return true;
}
return false;
}
示例3: getThisLocalResourceTag
public static String getThisLocalResourceTag(){
/*
2.6.32-431.29.2.el6.x86_64
3.10.0-514.6.1.el7.x86_64
*/
String osVersion = System.getProperty("os.version");
if(osVersion == null){
return null;
}
if(Shell.LINUX){
if(osVersion.contains("el6")) {
return LR_TAG_CENTOS6;
}
if(osVersion.contains("el7")) {
return LR_TAG_CENTOS7;
}
}
if(Shell.MAC){
if(osVersion.startsWith("10.")) {
return LR_TAG_MACOS10;
}
}
return null;
}