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.vfs2.provider;
18  
19  import java.io.IOException;
20  
21  import org.apache.commons.vfs2.RandomAccessContent;
22  import org.apache.commons.vfs2.util.RandomAccessMode;
23  
24  /**
25   * Implements the {@link java.io.DataOutput} part of the {@link RandomAccessContent} interface and throws
26   * {@link UnsupportedOperationException} when one of these methods are called. For read-only random access
27   * implementations.
28   */
29  public abstract class AbstractRandomAccessContent implements RandomAccessContent {
30  
31      protected AbstractRandomAccessContent(final RandomAccessMode mode) {
32      }
33  
34      /**
35       * @deprecated see {@link java.io.DataInputStream#readLine()} This method will be removed when it is removed from
36       *             the DataInput interface this class implements (which will probably never happen).
37       * @return The line as a String.
38       * @throws IOException if an error occurs.
39       */
40      @Override
41      @Deprecated
42      public String readLine() throws IOException {
43          throw new UnsupportedOperationException("deprecated");
44      }
45  
46      @Override
47      public void write(final byte[] b) throws IOException {
48          throw new UnsupportedOperationException();
49      }
50  
51      @Override
52      public void write(final byte[] b, final int off, final int len) throws IOException {
53          throw new UnsupportedOperationException();
54      }
55  
56      @Override
57      public void write(final int b) throws IOException {
58          throw new UnsupportedOperationException();
59      }
60  
61      @Override
62      public void writeBoolean(final boolean v) throws IOException {
63          throw new UnsupportedOperationException();
64      }
65  
66      @Override
67      public void writeByte(final int v) throws IOException {
68          throw new UnsupportedOperationException();
69      }
70  
71      @Override
72      public void writeBytes(final String s) throws IOException {
73          throw new UnsupportedOperationException();
74      }
75  
76      @Override
77      public void writeChar(final int v) throws IOException {
78          throw new UnsupportedOperationException();
79      }
80  
81      @Override
82      public void writeChars(final String s) throws IOException {
83          throw new UnsupportedOperationException();
84      }
85  
86      @Override
87      public void writeDouble(final double v) throws IOException {
88          throw new UnsupportedOperationException();
89      }
90  
91      @Override
92      public void writeFloat(final float v) throws IOException {
93          throw new UnsupportedOperationException();
94      }
95  
96      @Override
97      public void writeInt(final int v) throws IOException {
98          throw new UnsupportedOperationException();
99      }
100 
101     @Override
102     public void writeLong(final long v) throws IOException {
103         throw new UnsupportedOperationException();
104     }
105 
106     @Override
107     public void writeShort(final int v) throws IOException {
108         throw new UnsupportedOperationException();
109     }
110 
111     @Override
112     public void writeUTF(final String str) throws IOException {
113         throw new UnsupportedOperationException();
114     }
115 }