org.assertj.core.util.Files.temporaryFolderPath()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.assertj.core.util.Files.temporaryFolderPath()方法的一些代码示例,展示了Files.temporaryFolderPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Files.temporaryFolderPath()方法的具体详情如下:
包路径:org.assertj.core.util.Files
类名称:Files
方法名:temporaryFolderPath

Files.temporaryFolderPath介绍

[英]Returns the path of the system's temporary directory. This method appends the system's file separator at the end of the path.
[中]返回系统临时目录的路径。此方法在路径末尾附加系统的文件分隔符。

代码示例

代码示例来源:origin: org.assertj/assertj-core

/**
 * Returns the system's temporary directory.
 * 
 * @return the system's temporary directory.
 * @throws RuntimeException if this method cannot find or create the system's temporary directory.
 */
public static File temporaryFolder() {
 File temp = new File(temporaryFolderPath());
 if (!temp.isDirectory()) {
  throw new RuntimeException("Unable to find temporary directory");
 }
 return temp;
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Returns the system's temporary directory.
 * 
 * @return the system's temporary directory.
 * @throws RuntimeException if this method cannot find or create the system's temporary directory.
 */
public static File temporaryFolder() {
 File temp = new File(temporaryFolderPath());
 if (!temp.isDirectory()) {
  throw new RuntimeException("Unable to find temporary directory");
 }
 return temp;
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Creates a new directory in the system's temporary directory. The name of the directory will be the result of:
 * <pre><code class='java'> UUID.randomUUID().toString();</code></pre>
 * 
 * @return the created file.
 */
public static File newTemporaryFolder() {
 String tempFileName = UUID.randomUUID().toString();
 return newFolder(concat(temporaryFolderPath(), tempFileName));
}

代码示例来源:origin: org.assertj/assertj-core

/**
 * Creates a new file in the system's temporary directory. The name of the file will be the result of:
 * <pre><code class='java'> concat(UUID.randomUUID().toString(), &quot;.txt&quot;);</code></pre>
 * 
 * @return the created file.
 */
public static File newTemporaryFile() {
 String tempFileName = concat(UUID.randomUUID().toString(), ".txt");
 return newFile(concat(temporaryFolderPath(), tempFileName));
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Creates a new directory in the system's temporary directory. The name of the directory will be the result of:
 * <pre><code class='java'> UUID.randomUUID().toString();</code></pre>
 * 
 * @return the created file.
 */
public static File newTemporaryFolder() {
 String tempFileName = UUID.randomUUID().toString();
 return newFolder(concat(temporaryFolderPath(), tempFileName));
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Creates a new file in the system's temporary directory. The name of the file will be the result of:
 * <pre><code class='java'> concat(UUID.randomUUID().toString(), &quot;.txt&quot;);</code></pre>
 * 
 * @return the created file.
 */
public static File newTemporaryFile() {
 String tempFileName = concat(UUID.randomUUID().toString(), ".txt");
 return newFile(concat(temporaryFolderPath(), tempFileName));
}

代码示例来源:origin: org.assertj/assertj-core-java8

/**
 * Returns the system's temporary directory.
 * 
 * @return the system's temporary directory.
 * @throws FilesException if this method cannot find or create the system's temporary directory.
 */
public static File temporaryFolder() {
 File temp = new File(temporaryFolderPath());
 if (!temp.isDirectory()) {
  throw new FilesException("Unable to find temporary directory");
 }
 return temp;
}

代码示例来源:origin: org.assertj/assertj-core-java8

/**
 * Creates a new directory in the system's temporary directory. The name of the directory will be the result of:
 * <p/>
 * 
 * <pre><code class='java'>
 * System.currentTimeMillis();
 * </code></pre>
 * 
 * @return the created file.
 */
public static File newTemporaryFolder() {
 String tempFileName = String.valueOf(System.currentTimeMillis());
 return newFolder(concat(temporaryFolderPath(), tempFileName));
}

代码示例来源:origin: org.assertj/assertj-core-java8

/**
 * Creates a new file in the system's temporary directory. The name of the file will be the result of:
 * <p/>
 * 
 * <pre><code class='java'>
 * concat(String.valueOf(System.currentTimeMillis()), &quot;.txt&quot;);
 * </code></pre>
 * 
 * @return the created file.
 */
public static File newTemporaryFile() {
 String tempFileName = concat(valueOf(System.currentTimeMillis()), ".txt");
 return newFile(concat(temporaryFolderPath(), tempFileName));
}

相关文章