Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
restored ioexception to interface. Caused too much grief
Browse files Browse the repository at this point in the history
  • Loading branch information
krosenvold committed Jan 22, 2015
1 parent 7b34d98 commit d0afb61
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import javax.annotation.Nonnull;
import java.io.IOException;


/**
Expand All @@ -40,5 +41,5 @@ public interface FileSelector
* It is recommended, that the caller creates an instance
* of {@link org.codehaus.plexus.components.io.resources.PlexusIoResource}.
*/
boolean isSelected( @Nonnull FileInfo fileInfo );
boolean isSelected( @Nonnull FileInfo fileInfo ) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,16 @@ boolean doNext()
{
while (it.hasNext()){
PlexusIoResource candidate = it.next();
if (isSelected( candidate )){
next = candidate;
return true;
try
{
if (isSelected( candidate )){
next = candidate;
return true;
}
}
catch ( IOException e )
{
throw new RuntimeException( e );
}
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public boolean isIncludingEmptyDirectories()
}

protected boolean isSelected( PlexusIoResource plexusIoResource )
throws IOException
{
FileSelector[] fileSelectors = getFileSelectors();
if ( fileSelectors != null )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ public boolean hasNext()
{
if ( next == null )
{
next = getNextResource();
try
{
next = getNextResource();
}
catch ( IOException e )
{
throw new RuntimeException( e );
}
}
return next != null;
}
Expand Down Expand Up @@ -72,5 +79,5 @@ public void close()
/**
* Returns the next resource or null if no next resource;
*/
protected abstract PlexusIoResource getNextResource();
protected abstract PlexusIoResource getNextResource() throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ class FwdIterator
/**
* Returns the next resource or null if no next resource;
*/
protected PlexusIoResource getNextResource(){
protected PlexusIoResource getNextResource()
throws IOException
{
if (!iter.hasNext()) return null;
PlexusIoResource plexusIoResource = iter.next();

Expand Down

0 comments on commit d0afb61

Please sign in to comment.