Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop dependency on Commons IO #28

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/kohsuke/stapler/LocalizerMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void execute() throws MojoExecutionException {
throw new Error(e); // impossible
}

for( Resource res : (List<Resource>)project.getResources() ) {
for (Resource res : project.getResources()) {
File dir = new File(res.getDirectory());
processDirectory(dir);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class LocalizerProgressMojo extends AbstractMojo {
@Override
public void execute() {
L10nProgress r = new L10nProgress();
for( Resource root : (Collection<Resource>)project.getResources() ) {
for (Resource root : project.getResources()) {
r.parseRecursively(new File(root.getDirectory()));
}
System.out.println(r.toHatena());
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/org/kohsuke/stapler/TaglibDocMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import com.sun.xml.txw2.TXW;
import com.sun.xml.txw2.output.StreamSerializer;
import org.apache.commons.io.FileUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.execution.MavenSession;
Expand Down Expand Up @@ -58,6 +57,9 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -156,7 +158,7 @@ private void writeTaglibXml() throws MojoExecutionException {
File taglibsXml = new File(project.getBasedir(), "target/taglib.xml");
taglibsXml.getParentFile().mkdirs();
Tags tags = TXW.create(Tags.class,new StreamSerializer(new FileOutputStream(taglibsXml)));
for (Resource res : (List<Resource>) project.getResources()) {
for (Resource res : project.getResources()) {
scanTagLibs(new File(res.getDirectory()),"",tags);
}
tags.commit();
Expand Down Expand Up @@ -195,7 +197,8 @@ private void scanTagLibs(File dir, String uri, Tags tags) throws IOException {
private void parseTagLib(File dir, String uri, Library lib) throws IOException {
getLog().info("Processing "+dir);

List<String> markerFile = FileUtils.readLines(new File(dir, "taglib"));
List<String> markerFile = new ArrayList<>(
Files.readAllLines(dir.toPath().resolve("taglib"), StandardCharsets.UTF_8));
if (markerFile.size() == 0) {
markerFile.add(uri);
}
Expand Down