File tree Expand file tree Collapse file tree 7 files changed +19
-11
lines changed
src/test/java/org/springframework/ldap/ldif
src/test/java/org/springframework/ldap/odm/test
test/integration-tests-ad/src/test/java/org/springframework/ldap/itest/ad Expand file tree Collapse file tree 7 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ dependencies {
30
30
api " commons-cli:commons-cli:1.5.0"
31
31
api " commons-collections:commons-collections:3.2.2"
32
32
api " commons-httpclient:commons-httpclient:3.1"
33
- api " commons-io:commons-io:2.11.0"
34
33
api " commons-lang:commons-lang:2.6"
35
34
api " commons-logging:commons-logging:1.2"
36
35
api " commons-pool:commons-pool:1.6"
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ dependencies {
9
9
testImplementation platform(' org.junit:junit-bom' )
10
10
testImplementation " org.junit.vintage:junit-vintage-engine"
11
11
testImplementation " junit:junit"
12
- testImplementation " commons-io:commons-io"
13
12
testImplementation " org.assertj:assertj-core"
14
13
testImplementation (" log4j:log4j:1.2.17" ) {
15
14
exclude group : ' javax.jms'
Original file line number Diff line number Diff line change 18
18
19
19
import java .io .File ;
20
20
import java .io .IOException ;
21
+ import java .nio .file .Files ;
21
22
22
- import org .apache .commons .io .FileUtils ;
23
23
import org .junit .Test ;
24
24
25
25
import org .springframework .ldap .ldif .parser .LdifParser ;
@@ -39,7 +39,7 @@ public class Ldap233LdifParserTests {
39
39
@ Test
40
40
public void ldap233Test () throws IOException {
41
41
File testFile = File .createTempFile ("ldapTest" , ".ldif" );
42
- FileUtils .write (testFile , "This is just some random text" );
42
+ Files .write (testFile . toPath () , "This is just some random text" . getBytes () );
43
43
44
44
LdifParser parser = new LdifParser (testFile );
45
45
parser .setRecordSpecification (new BasicSchemaSpecification ());
Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ dependencies {
25
25
26
26
testImplementation project(" :spring-ldap-test" ),
27
27
" junit:junit" ,
28
- " jdepend:jdepend" ,
29
- " commons-io:commons-io"
28
+ " jdepend:jdepend"
30
29
testImplementation " org.apache.directory.server:apacheds-core-entry"
31
30
testImplementation " org.apache.directory.server:apacheds-core"
32
31
testImplementation " org.apache.directory.server:apacheds-protocol-ldap"
Original file line number Diff line number Diff line change 17
17
package org .springframework .ldap .odm .test ;
18
18
19
19
import java .io .File ;
20
+ import java .io .FileOutputStream ;
21
+ import java .io .OutputStream ;
20
22
import java .lang .reflect .Method ;
21
23
import java .net .URL ;
22
24
import java .net .URLClassLoader ;
25
+ import java .nio .file .Files ;
26
+ import java .nio .file .Path ;
23
27
import java .util .Iterator ;
24
28
import java .util .regex .Matcher ;
25
29
import java .util .regex .Pattern ;
26
30
27
31
import javax .naming .ldap .LdapName ;
28
32
29
- import org .apache .commons .io .FileUtils ;
30
33
import org .junit .After ;
31
34
import org .junit .AfterClass ;
32
35
import org .junit .Before ;
@@ -154,7 +157,10 @@ public void generate() throws Exception {
154
157
final String packageName = "org.springframework.ldap.odm.testclasses" ;
155
158
156
159
File tempFile = File .createTempFile ("test-odm-syntax-to-class-map" , ".txt" );
157
- FileUtils .copyInputStreamToFile (new ClassPathResource ("/syntax-to-class-map.txt" ).getInputStream (), tempFile );
160
+ Path from = new ClassPathResource ("/syntax-to-class-map.txt" ).getFile ().toPath ();
161
+ try (OutputStream to = new FileOutputStream (tempFile )) {
162
+ Files .copy (from , to );
163
+ }
158
164
159
165
// Add classes dir to class path - needed for compilation
160
166
System .setProperty ("java.class.path" ,
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ dependencies {
12
12
api " org.springframework:spring-test"
13
13
14
14
implementation " com.google.code.typica:typica"
15
- implementation " commons-io:commons-io"
16
15
17
16
optional " org.apache.directory.server:apacheds-core-entry"
18
17
optional " org.apache.directory.server:apacheds-core"
Original file line number Diff line number Diff line change 17
17
package org .springframework .ldap .itest .ad ;
18
18
19
19
import java .io .File ;
20
+ import java .io .FileOutputStream ;
21
+ import java .io .OutputStream ;
20
22
import java .lang .reflect .Method ;
21
23
import java .net .URL ;
22
24
import java .net .URLClassLoader ;
25
+ import java .nio .file .Files ;
26
+ import java .nio .file .Path ;
23
27
import java .util .HashMap ;
24
28
import java .util .regex .Matcher ;
25
29
import java .util .regex .Pattern ;
26
30
27
- import org .apache .commons .io .FileUtils ;
28
31
import org .junit .After ;
29
32
import org .junit .Before ;
30
33
import org .junit .Test ;
@@ -156,7 +159,10 @@ public void verifySchemaToJavaOnAd() throws Exception {
156
159
final String packageName = "org.springframework.ldap.odm.testclasses" ;
157
160
158
161
File tempFile = File .createTempFile ("test-odm-syntax-to-class-map" , ".txt" );
159
- FileUtils .copyInputStreamToFile (new ClassPathResource ("/syntax-to-class-map.txt" ).getInputStream (), tempFile );
162
+ Path from = new ClassPathResource ("/syntax-to-class-map.txt" ).getFile ().toPath ();
163
+ try (OutputStream to = new FileOutputStream (tempFile )) {
164
+ Files .copy (from , to );
165
+ }
160
166
161
167
// Add classes dir to class path - needed for compilation
162
168
System .setProperty ("java.class.path" ,
You can’t perform that action at this time.
0 commit comments