|
@@ -261,7 +261,7 @@ public final class FileHelper {
|
|
|
* @throws IOException
|
|
* @throws IOException
|
|
|
*/
|
|
*/
|
|
|
public static File createTempFile(String prefix, String suffix, Class<?> clazz) throws IOException {
|
|
public static File createTempFile(String prefix, String suffix, Class<?> clazz) throws IOException {
|
|
|
- final String dir = PathHelper.getClassDir(clazz);
|
|
|
|
|
|
|
+ final String dir = getClassDir(clazz);
|
|
|
final File file = Li.location(dir);
|
|
final File file = Li.location(dir);
|
|
|
if(!file.exists() && !file.mkdirs()) {
|
|
if(!file.exists() && !file.mkdirs()) {
|
|
|
throw new IOException("can't create directory: " + file);
|
|
throw new IOException("can't create directory: " + file);
|
|
@@ -284,7 +284,7 @@ public final class FileHelper {
|
|
|
* @throws IOException
|
|
* @throws IOException
|
|
|
*/
|
|
*/
|
|
|
public static File createTempFile(String suffix, Class<?> clazz) throws IOException {
|
|
public static File createTempFile(String suffix, Class<?> clazz) throws IOException {
|
|
|
- final String dir = PathHelper.getClassDir(clazz);
|
|
|
|
|
|
|
+ final String dir = getClassDir(clazz);
|
|
|
final File file = Li.location(dir);
|
|
final File file = Li.location(dir);
|
|
|
if(!file.exists() && !file.mkdirs()) {
|
|
if(!file.exists() && !file.mkdirs()) {
|
|
|
throw new IOException("can't create directory: " + file);
|
|
throw new IOException("can't create directory: " + file);
|
|
@@ -299,4 +299,8 @@ public final class FileHelper {
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private static String getClassDir(Class<?> clazz) {
|
|
|
|
|
+ return clazz.getPackage().getName().replace(".", File.separator);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|