This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
file-utils.yml
59 lines (58 loc) · 2.89 KB
/
file-utils.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
type: specs.openrewrite.org/v1beta/recipe
name: com.github.timtebeek.maven.rewrite.FindFileUtils
displayName: Find FileUtils
description: https://issues.apache.org/jira/browse/MNG-6825
recipeList:
- org.openrewrite.java.search.FindMethods:
methodPattern: org.codehaus.plexus.util.FileUtils *(..)
- org.openrewrite.java.search.FindMethods:
methodPattern: org.apache.maven.shared.utils.io.FileUtils *(..)
- org.openrewrite.java.search.FindMethods:
methodPattern: org.apache.commons.io.FileUtils *(..)
---
type: specs.openrewrite.org/v1beta/recipe
name: com.github.timtebeek.maven.rewrite.FileUtilsToCommonsIO
displayName: Replace FileUtils with Commons IO
description: https://issues.apache.org/jira/browse/MNG-6825
recipeList:
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.codehaus.plexus.util.FileUtils fileRead(java.io.File)
newMethodName: readFileToString
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.codehaus.plexus.util.FileUtils fileRead(java.io.File, String)
newMethodName: readFileToString
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.codehaus.plexus.util.FileUtils loadFile(java.io.File)
newMethodName: readLines
- org.openrewrite.java.ReorderMethodArguments:
methodPattern: org.codehaus.plexus.util.FileUtils fileWrite(java.io.File, String, String)
oldParameterNames:
- file
- content
- encoding
newParameterNames:
- file
- encoding
- content
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.codehaus.plexus.util.FileUtils fileWrite(java.io.File, String, String)
newMethodName: write
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.codehaus.plexus.util.FileUtils
newFullyQualifiedTypeName: org.apache.commons.io.FileUtils
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.apache.maven.shared.utils.io.FileUtils
newFullyQualifiedTypeName: org.apache.commons.io.FileUtils
# Revert cases without known replacement until handled in dedicated recipes
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.apache.commons.io.FileUtils copyDirectoryStructureIfModified(java.io.File, java.io.File)
fullyQualifiedTargetTypeName: org.codehaus.plexus.util.FileUtils
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.apache.commons.io.FileUtils fileExists(String)
fullyQualifiedTargetTypeName: org.codehaus.plexus.util.FileUtils
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.apache.commons.io.FileUtils fileWrite(String, String, String)
fullyQualifiedTargetTypeName: org.codehaus.plexus.util.FileUtils
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.apache.commons.io.FileUtils normalize(String)
fullyQualifiedTargetTypeName: org.codehaus.plexus.util.FileUtils