OPEN - issue BATCH-339: ItemStream.mark() and reset() should throw a checked exception

http://jira.springframework.org/browse/BATCH-339

Missing classes
This commit is contained in:
dsyer
2008-02-08 13:59:25 +00:00
parent c43c1b4466
commit 1efb6fedc9
7 changed files with 214 additions and 6 deletions

View File

@@ -139,8 +139,7 @@ public class ResourceLineReader extends ItemStreamAdapter implements LineReader,
}
/**
* @return
* @throws IOException
* @return the next non-comment line
*/
private String readLine() {
return getState().readLine();
@@ -209,7 +208,7 @@ public class ResourceLineReader extends ItemStreamAdapter implements LineReader,
/**
* Mark the state for return later with reset. Uses the read-ahead limit
* from the underlying {@link BufferedReader}, which means that there is a
* from an underlying {@link BufferedReader}, which means that there is a
* limit to how much data can be recovered if the mark needs to be reset.
*
* @see #reset()
@@ -250,9 +249,6 @@ public class ResourceLineReader extends ItemStreamAdapter implements LineReader,
private int markedLineCount = -1;
public String readLine() {
if (reader == null) {
open();
}
String line = null;
try {

View File

@@ -0,0 +1,47 @@
/*
* Copyright 2006-2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.item.exception;
/**
* @author Dave Syer
*
*/
public class MarkFailedException extends StreamException {
/**
* @param message
*/
public MarkFailedException(String message) {
super(message);
}
/**
* @param msg
* @param nested
*/
public MarkFailedException(String msg, Throwable nested) {
super(msg, nested);
}
/**
* @param msg
* @param nested
*/
public MarkFailedException(Throwable nested) {
super(nested);
}
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright 2006-2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.item.exception;
/**
* @author Dave Syer
*
*/
public class ResetFailedException extends StreamException {
/**
* @param message
*/
public ResetFailedException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
/**
* @param msg
* @param nested
*/
public ResetFailedException(String msg, Throwable nested) {
super(msg, nested);
}
/**
* @param msg
* @param nested
*/
public ResetFailedException(Throwable nested) {
super(nested);
}
}