View Javadoc

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *      http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   */
    17  package org.apache.commons.vfs.provider;
    18
    19  import org.apache.commons.vfs.RandomAccessContent;
    20  import org.apache.commons.vfs.util.RandomAccessMode;
    21
    22  import java.io.IOException;
    23
    24  /***
    25   * Implements the DataOutput part of the RandomAccessContent interface and throws
    26   * UnsupportedOperationException if one of those methods are called.
    27   * (for read-only random access implementations)
    28   *
    29   * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
    30   * @version $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
    31   */
    32  public abstract class AbstractRandomAccessContent implements RandomAccessContent
    33  {
    34      private final RandomAccessMode mode;
    35
    36      protected AbstractRandomAccessContent(final RandomAccessMode mode)
    37      {
    38          this.mode = mode;
    39      }
    40
    41      public void writeDouble(double v) throws IOException
    42      {
    43          throw new UnsupportedOperationException();
    44      }
    45
    46      public void writeFloat(float v) throws IOException
    47      {
    48          throw new UnsupportedOperationException();
    49      }
    50
    51      public void write(int b) throws IOException
    52      {
    53          throw new UnsupportedOperationException();
    54      }
    55
    56      public void writeByte(int v) throws IOException
    57      {
    58          throw new UnsupportedOperationException();
    59      }
    60
    61      public void writeChar(int v) throws IOException
    62      {
    63          throw new UnsupportedOperationException();
    64      }
    65
    66      public void writeInt(int v) throws IOException
    67      {
    68          throw new UnsupportedOperationException();
    69      }
    70
    71      public void writeShort(int v) throws IOException
    72      {
    73          throw new UnsupportedOperationException();
    74      }
    75
    76      public void writeLong(long v) throws IOException
    77      {
    78          throw new UnsupportedOperationException();
    79      }
    80
    81      public void writeBoolean(boolean v) throws IOException
    82      {
    83          throw new UnsupportedOperationException();
    84      }
    85
    86      public void write(byte b[]) throws IOException
    87      {
    88          throw new UnsupportedOperationException();
    89      }
    90
    91      public void write(byte b[], int off, int len) throws IOException
    92      {
    93          throw new UnsupportedOperationException();
    94      }
    95
    96      public void writeBytes(String s) throws IOException
    97      {
    98          throw new UnsupportedOperationException();
    99      }
    100
    101     public void writeChars(String s) throws IOException
    102     {
    103         throw new UnsupportedOperationException();
    104     }
    105
    106     public void writeUTF(String str) throws IOException
    107     {
    108         throw new UnsupportedOperationException();
    109     }
    110
    111     /***
    112      * @deprecated see {@link java.io.DataInputStream#readLine()}
    113      */
    114     public String readLine() throws IOException
    115     {
    116         throw new UnsupportedOperationException("deprecated");
    117     }
    118 }