Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Jun 1, 2022
2 parents 829a55e + a2e4a1b commit d4f098f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/takes/tk/TkFiles.java
Expand Up @@ -24,11 +24,10 @@
package org.takes.tk;

import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.nio.file.Files;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.cactoos.io.InputOf;
import org.takes.HttpException;
import org.takes.Request;
import org.takes.Response;
Expand Down Expand Up @@ -77,7 +76,7 @@ public TkFiles(final File base) {
super(
new Take() {
@Override
public Response act(final Request request) throws IOException {
public Response act(final Request request) throws Exception {
final File file = new File(
base, new RqHref.Base(request).href().path()
);
Expand All @@ -89,7 +88,7 @@ public Response act(final Request request) throws IOException {
)
);
}
return new RsWithBody(Files.newInputStream(file.toPath()));
return new RsWithBody(new InputOf(file).stream());
}
}
);
Expand Down

0 comments on commit d4f098f

Please sign in to comment.