Skip to content

Commit

Permalink
JsonFilesTask: remove reference to Gradle private API org.gradle.util…
Browse files Browse the repository at this point in the history
  • Loading branch information
johan12345 committed Jul 19, 2020
1 parent 7fd269b commit 8036bd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion opacclient/buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ dependencies {
implementation gradleApi()
implementation localGroovy()
implementation 'org.json:json:20090211'
}
implementation 'commons-io:commons-io:2.7'
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.geeksfactory.opacclient.gradle

import org.apache.commons.io.FileUtils
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import org.gradle.util.GFileUtils
import org.json.JSONArray
import org.json.JSONObject

Expand All @@ -25,8 +25,8 @@ class JsonFilesTask extends DefaultTask {
conn.setSSLSocketFactory(createSSLSocketFactory())
String response = conn.inputStream.getText("UTF-8")
JSONArray data = new JSONArray(response)
GFileUtils.mkdirs(new File(bibsDir))
GFileUtils.cleanDirectory(new File(bibsDir))
new File(bibsDir).mkdirs()
FileUtils.cleanDirectory(new File(bibsDir))
for (int i = 0; i < data.length(); i++) {
JSONObject library = data.get(i)
String id = library.getString("_id")
Expand All @@ -52,4 +52,4 @@ class JsonFilesTask extends DefaultTask {
SSLSocketFactory factory = context.getSocketFactory()
return factory
}
}
}

0 comments on commit 8036bd9

Please sign in to comment.