本文整理汇总了Java中com.gemstone.gemfire.internal.util.IOUtils.tryGetCanonicalPathElseGetAbsolutePath方法的典型用法代码示例。如果您正苦于以下问题:Java IOUtils.tryGetCanonicalPathElseGetAbsolutePath方法的具体用法?Java IOUtils.tryGetCanonicalPathElseGetAbsolutePath怎么用?Java IOUtils.tryGetCanonicalPathElseGetAbsolutePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.gemstone.gemfire.internal.util.IOUtils
的用法示例。
在下文中一共展示了IOUtils.tryGetCanonicalPathElseGetAbsolutePath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getServerLogFileCanonicalPath
import com.gemstone.gemfire.internal.util.IOUtils; //导入方法依赖的package包/类
private static String getServerLogFileCanonicalPath(final ServerLauncher launcher) {
final InternalDistributedSystem system = InternalDistributedSystem.getAnyInstance();
if (system != null) {
final File logFile = system.getConfig().getLogFile();
if (logFile != null && logFile.isFile()) {
final String logFileCanonicalPath = IOUtils.tryGetCanonicalPathElseGetAbsolutePath(logFile);
if (!StringUtils.isBlank(logFileCanonicalPath)) {
return logFileCanonicalPath;
}
}
}
return launcher.getLogFileCanonicalPath();
}
示例2: getLogFileCanonicalPath
import com.gemstone.gemfire.internal.util.IOUtils; //导入方法依赖的package包/类
private static String getLogFileCanonicalPath(LocatorLauncher launcher) {
if (InternalLocator.hasLocator()) {
final InternalLocator locator = InternalLocator.getLocator();
final File logFile = locator.getLogFile();
if (logFile != null && logFile.isFile()) {
final String logFileCanonicalPath = IOUtils.tryGetCanonicalPathElseGetAbsolutePath(logFile);
if (!StringUtils.isBlank(logFileCanonicalPath)) { // this is probably not need but a safe check none-the-less.
return logFileCanonicalPath;
}
}
}
return launcher.getLogFileCanonicalPath();
}
示例3: getLogFilePath
import com.gemstone.gemfire.internal.util.IOUtils; //导入方法依赖的package包/类
public String getLogFilePath() {
return IOUtils.tryGetCanonicalPathElseGetAbsolutePath(new File(logDir, "gfsh-%u_%g.log"));
}
示例4: resolvePathname
import com.gemstone.gemfire.internal.util.IOUtils; //导入方法依赖的package包/类
/**
* Resolves file system path relative to Gfsh. If the pathname is not specified, then pathname is returned.
* <p/>
*
* @param pathname
* a String value specifying the file system pathname to resolve.
* @return a String specifying a path relative to Gfsh.
*/
// Moved form LauncherLifeCycleCommands @author jblum
public static String resolvePathname(final String pathname) {
return (StringUtils.isBlank(pathname) ? pathname : IOUtils.tryGetCanonicalPathElseGetAbsolutePath(new File(pathname)));
}
示例5: getWorkingDirectory
import com.gemstone.gemfire.internal.util.IOUtils; //导入方法依赖的package包/类
/**
* Gets the working directory pathname in which the Server will be ran. If the directory is unspecified,
* then working directory defaults to the current directory.
*
* @return a String indicating the working directory pathname.
* @see #setWorkingDirectory(String)
*/
public String getWorkingDirectory() {
return IOUtils.tryGetCanonicalPathElseGetAbsolutePath(
new File(StringUtils.defaultIfBlank(this.workingDirectory, DEFAULT_WORKING_DIRECTORY)));
}
示例6: getWorkingDirectory
import com.gemstone.gemfire.internal.util.IOUtils; //导入方法依赖的package包/类
/**
* Gets the working directory pathname in which the Locator will be ran. If the directory is unspecified,
* then working directory defaults to the current directory.
*
* @return a String indicating the working directory pathname.
* @see #setWorkingDirectory(String)
*/
public String getWorkingDirectory() {
return IOUtils.tryGetCanonicalPathElseGetAbsolutePath(
new File(StringUtils.defaultIfBlank(this.workingDirectory, DEFAULT_WORKING_DIRECTORY)));
}