001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.commons.vfs.provider;
018:
019: import org.apache.commons.vfs.RandomAccessContent;
020: import org.apache.commons.vfs.util.RandomAccessMode;
021:
022: import java.io.IOException;
023:
024: /**
025: * Implements the DataOutput part of the RandomAccessContent interface and throws
026: * UnsupportedOperationException if one of those methods are called.
027: * (for read-only random access implementations)
028: *
029: * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
030: * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
031: */
032: public abstract class AbstractRandomAccessContent implements
033: RandomAccessContent {
034: private final RandomAccessMode mode;
035:
036: protected AbstractRandomAccessContent(final RandomAccessMode mode) {
037: this .mode = mode;
038: }
039:
040: public void writeDouble(double v) throws IOException {
041: throw new UnsupportedOperationException();
042: }
043:
044: public void writeFloat(float v) throws IOException {
045: throw new UnsupportedOperationException();
046: }
047:
048: public void write(int b) throws IOException {
049: throw new UnsupportedOperationException();
050: }
051:
052: public void writeByte(int v) throws IOException {
053: throw new UnsupportedOperationException();
054: }
055:
056: public void writeChar(int v) throws IOException {
057: throw new UnsupportedOperationException();
058: }
059:
060: public void writeInt(int v) throws IOException {
061: throw new UnsupportedOperationException();
062: }
063:
064: public void writeShort(int v) throws IOException {
065: throw new UnsupportedOperationException();
066: }
067:
068: public void writeLong(long v) throws IOException {
069: throw new UnsupportedOperationException();
070: }
071:
072: public void writeBoolean(boolean v) throws IOException {
073: throw new UnsupportedOperationException();
074: }
075:
076: public void write(byte b[]) throws IOException {
077: throw new UnsupportedOperationException();
078: }
079:
080: public void write(byte b[], int off, int len) throws IOException {
081: throw new UnsupportedOperationException();
082: }
083:
084: public void writeBytes(String s) throws IOException {
085: throw new UnsupportedOperationException();
086: }
087:
088: public void writeChars(String s) throws IOException {
089: throw new UnsupportedOperationException();
090: }
091:
092: public void writeUTF(String str) throws IOException {
093: throw new UnsupportedOperationException();
094: }
095:
096: /**
097: * @deprecated see {@link java.io.DataInputStream#readLine()}
098: */
099: public String readLine() throws IOException {
100: throw new UnsupportedOperationException("deprecated");
101: }
102: }
|