2016-07-20 22:13:03 +00:00
|
|
|
/* ====================================================================
|
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
|
The ASF licenses this file to You 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.apache.poi;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
|
|
|
|
|
import org.apache.poi.poifs.filesystem.DirectoryNode;
|
2018-08-31 00:25:50 +00:00
|
|
|
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
2016-07-20 22:13:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This holds the common functionality for all read-only
|
|
|
|
|
* POI Document classes, i.e. ones which don't support writing.
|
2016-07-21 10:27:27 +00:00
|
|
|
*
|
|
|
|
|
* @since POI 3.15 beta 3
|
2016-07-20 22:13:03 +00:00
|
|
|
*/
|
|
|
|
|
public abstract class POIReadOnlyDocument extends POIDocument {
|
2018-08-26 11:55:00 +00:00
|
|
|
protected POIReadOnlyDocument(DirectoryNode dir) {
|
2016-07-20 22:13:03 +00:00
|
|
|
super(dir);
|
|
|
|
|
}
|
2018-08-31 00:25:50 +00:00
|
|
|
protected POIReadOnlyDocument(POIFSFileSystem fs) {
|
2016-07-20 22:13:03 +00:00
|
|
|
super(fs);
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-20 22:18:25 +00:00
|
|
|
/**
|
|
|
|
|
* Note - writing is not yet supported for this file format, sorry.
|
2016-07-21 10:27:27 +00:00
|
|
|
*
|
|
|
|
|
* @throws IllegalStateException If you call the method, as writing is not supported
|
2016-07-20 22:18:25 +00:00
|
|
|
*/
|
2016-07-20 22:35:51 +00:00
|
|
|
@Override
|
2016-07-21 10:27:27 +00:00
|
|
|
public void write() {
|
2016-07-20 22:35:51 +00:00
|
|
|
throw new IllegalStateException("Writing is not yet implemented for this Document Format");
|
|
|
|
|
}
|
2016-07-20 22:18:25 +00:00
|
|
|
/**
|
|
|
|
|
* Note - writing is not yet supported for this file format, sorry.
|
2016-07-21 10:27:27 +00:00
|
|
|
*
|
|
|
|
|
* @throws IllegalStateException If you call the method, as writing is not supported
|
2016-07-20 22:18:25 +00:00
|
|
|
*/
|
2016-07-20 22:35:51 +00:00
|
|
|
@Override
|
2016-07-21 10:27:27 +00:00
|
|
|
public void write(File file) {
|
2016-07-20 22:35:51 +00:00
|
|
|
throw new IllegalStateException("Writing is not yet implemented for this Document Format");
|
|
|
|
|
}
|
2016-07-20 22:18:25 +00:00
|
|
|
/**
|
|
|
|
|
* Note - writing is not yet supported for this file format, sorry.
|
2016-07-21 10:27:27 +00:00
|
|
|
*
|
|
|
|
|
* @throws IllegalStateException If you call the method, as writing is not supported
|
2016-07-20 22:18:25 +00:00
|
|
|
*/
|
2016-07-20 22:13:03 +00:00
|
|
|
@Override
|
2016-07-21 10:27:27 +00:00
|
|
|
public void write(OutputStream out) {
|
2016-07-20 22:13:03 +00:00
|
|
|
throw new IllegalStateException("Writing is not yet implemented for this Document Format");
|
|
|
|
|
}
|
|
|
|
|
}
|