Skip to content

Commit d97dd71

Browse files
fix: unwanted method name change
1 parent 0393b8f commit d97dd71

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/main/kotlin/app/config/FileConfigurator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class FileConfigurator : Configurator {
212212

213213
try {
214214
loadConfig = Files.newBufferedReader(FileHelper
215-
.toPath(CONFIG_FILE_NAME)).use {
215+
.getPath(CONFIG_FILE_NAME)).use {
216216
mapper.readValue(it, Config::class.java)
217217
}
218218
} catch (e: IOException) {
@@ -241,7 +241,7 @@ class FileConfigurator : Configurator {
241241
*/
242242
override fun saveToFile() {
243243
try {
244-
Files.newBufferedWriter(FileHelper.toPath(CONFIG_FILE_NAME)).use {
244+
Files.newBufferedWriter(FileHelper.getPath(CONFIG_FILE_NAME)).use {
245245
mapper.writeValue(it, persistent)
246246
}
247247
} catch (e: IOException) {

src/main/kotlin/app/hashers/CodeLongevity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class CodeLongevity(private val serverRepo: Repo,
151151
catch(e: Exception) { throw Exception("No branch") }
152152

153153
val df = DiffFormatter(DisabledOutputStream.INSTANCE)
154-
val dataPath = FileHelper.toPath(serverRepo.rehash, "longevity")
154+
val dataPath = FileHelper.getPath(serverRepo.rehash, "longevity")
155155

156156
init {
157157
df.setRepository(repo)

src/main/kotlin/app/utils/FileHelper.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
package app.utils
55

6-
import app.Logger
76
import java.io.File
87
import java.net.URLDecoder
98
import java.nio.file.Files
@@ -18,7 +17,7 @@ object FileHelper {
1817
private val jarPath = getJarPath()
1918
private val settingsPath = jarPath.resolve(dirName)
2019

21-
fun toPath(name: String, vararg parts: String): Path {
20+
fun getPath(name: String, vararg parts: String): Path {
2221
val path = settingsPath.resolve(Paths.get("", *parts))
2322
if (Files.notExists(path)) {
2423
Files.createDirectories(path)
@@ -27,11 +26,11 @@ object FileHelper {
2726
}
2827

2928
fun getFile(name: String, vararg parts: String): File {
30-
return toPath(name, *parts).toFile()
29+
return getPath(name, *parts).toFile()
3130
}
3231

3332
fun notExists(name:String, vararg parts: String): Boolean {
34-
return Files.notExists(toPath(name, *parts))
33+
return Files.notExists(getPath(name, *parts))
3534
}
3635

3736
fun getFileExtension(path: String): String {
@@ -53,8 +52,6 @@ object FileHelper {
5352
val substitutePath = if (this.startsWith("~" + File.separator)) {
5453
System.getProperty("user.home") + this.substring(1)
5554
} else { this }
56-
val pathTemp = Paths.get(substitutePath).toAbsolutePath().normalize()
57-
println(pathTemp.toString())
58-
return pathTemp
55+
return Paths.get(substitutePath).toAbsolutePath().normalize()
5956
}
6057
}

0 commit comments

Comments
 (0)