当前位置: 首页>>代码示例>>Java>>正文


Java IOUtils.tryGetCanonicalPathElseGetAbsolutePath方法代码示例

本文整理汇总了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();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:16,代码来源:ServerLauncher.java

示例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();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:15,代码来源:LocatorLauncher.java

示例3: getLogFilePath

import com.gemstone.gemfire.internal.util.IOUtils; //导入方法依赖的package包/类
public String getLogFilePath() {
  return IOUtils.tryGetCanonicalPathElseGetAbsolutePath(new File(logDir, "gfsh-%u_%g.log"));
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:4,代码来源:GfshConfig.java

示例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)));
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:13,代码来源:CliUtil.java

示例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)));
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:12,代码来源:ServerLauncher.java

示例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)));
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:12,代码来源:LocatorLauncher.java


注:本文中的com.gemstone.gemfire.internal.util.IOUtils.tryGetCanonicalPathElseGetAbsolutePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。