/** * Configures the state of this object instance for reading mode. If the * current state doesn't allow reading, an exception will be thrown. */ private void initializeReadingStage() { // If we're already in the reading stage there's nothing to do. if (stage.equals(StorageStage.Reading)) { return; } if (stage.equals(StorageStage.Add)) { throw new OsmosisRuntimeException( "Cannot begin reading in " + StorageStage.Add + " stage, must call complete first."); } // If we haven't reached the reading stage yet, configure for output // first to ensure a file is available for reading. if (stage.compareTo(StorageStage.Reading) < 0) { stage = StorageStage.Reading; } // If we've passed the reading stage, we can't continue. if (stage.compareTo(StorageStage.Reading) > 0) { throw new OsmosisRuntimeException("Cannot read from storage once we've reached stage " + stage + "."); } }
/** * Configures the state of this object instance for reading mode. If the * current state doesn't allow reading, an exception will be thrown. */ private void initializeReadingStage() { // If we're already in the reading stage there's nothing to do. if (stage.equals(StorageStage.Reading)) { return; } if (stage.equals(StorageStage.Add)) { throw new OsmosisRuntimeException( "Cannot begin reading in " + StorageStage.Add + " stage, must call complete first."); } // If we haven't reached the reading stage yet, configure for output // first to ensure a file is available for reading. if (stage.compareTo(StorageStage.Reading) < 0) { stage = StorageStage.Reading; } // If we've passed the reading stage, we can't continue. if (stage.compareTo(StorageStage.Reading) > 0) { throw new OsmosisRuntimeException("Cannot read from storage once we've reached stage " + stage + "."); } }