Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ public boolean exists() {

public Reader reader() throws IOException {

// Will never return null, but an IOException if not found
final InputStream inputStream = this.resource.getInputStream();
final InputStream inputStream = inputStream();

if (!StringUtils.isEmptyOrWhitespace(this.characterEncoding)) {
return new BufferedReader(new InputStreamReader(new BufferedInputStream(inputStream), this.characterEncoding));
Expand All @@ -110,6 +109,11 @@ public Reader reader() throws IOException {

}

public InputStream inputStream() throws IOException {
// Will never return null, but an IOException if not found
return this.resource.getInputStream();
}

public ITemplateResource relative(final String relativeLocation) {
final Resource relativeResource;
try {
Expand Down Expand Up @@ -195,6 +199,11 @@ public Reader reader() throws IOException {
throw new IOException("Invalid relative resource", this.ioException);
}

@Override
public InputStream inputStream() throws IOException {
throw new IOException("Invalid relative resource", this.ioException);
}

@Override
public ITemplateResource relative(final String relativeLocation) {
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public boolean exists() {
public Reader reader() throws IOException {

// Will never return null, but an IOException if not found
final InputStream inputStream = this.resource.getInputStream();
final InputStream inputStream = inputStream();

if (!StringUtils.isEmptyOrWhitespace(this.characterEncoding)) {
return new BufferedReader(new InputStreamReader(new BufferedInputStream(inputStream), this.characterEncoding));
Expand All @@ -110,6 +110,11 @@ public Reader reader() throws IOException {

}

public InputStream inputStream() throws IOException {
// Will never return null, but an IOException if not found
return this.resource.getInputStream();
}

public ITemplateResource relative(final String relativeLocation) {
final Resource relativeResource;
try {
Expand Down Expand Up @@ -195,6 +200,11 @@ public Reader reader() throws IOException {
throw new IOException("Invalid relative resource", this.ioException);
}

@Override
public InputStream inputStream() throws IOException {
throw new IOException("Invalid relative resource", this.ioException);
}

@Override
public ITemplateResource relative(final String relativeLocation) {
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ public boolean exists() {

public Reader reader() throws IOException {

// Will never return null, but an IOException if not found
final InputStream inputStream = this.resource.getInputStream();
final InputStream inputStream = inputStream();

if (!StringUtils.isEmptyOrWhitespace(this.characterEncoding)) {
return new BufferedReader(new InputStreamReader(new BufferedInputStream(inputStream), this.characterEncoding));
Expand All @@ -110,6 +109,11 @@ public Reader reader() throws IOException {

}

public InputStream inputStream() throws IOException {
// Will never return null, but an IOException if not found
return this.resource.getInputStream();
}

public ITemplateResource relative(final String relativeLocation) {
final Resource relativeResource;
try {
Expand Down Expand Up @@ -195,6 +199,11 @@ public Reader reader() throws IOException {
throw new IOException("Invalid relative resource", this.ioException);
}

@Override
public InputStream inputStream() throws IOException {
throw new IOException("Invalid relative resource", this.ioException);
}

@Override
public ITemplateResource relative(final String relativeLocation) {
return this;
Expand Down