/*
 * Copyright 2006 Wyona
 *
 *  Licensed 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.wyona.org/licenses/APACHE-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.wyona.yanel.core.api.attributes;

import org.wyona.yanel.core.Path;
import org.wyona.yanel.core.Topic;

import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;

/**
 * DEV (not released yet), please be aware that this interface still might change ...
 */
public interface ModifiableV2 {
    // TODO: Shouldn't it be the other way around, that the Resource is passed to a Repository instead the Repository to the Resource?!
    //TODO: Shouldn't we use java.io.Serializable (writeObject, readObject)?!

    /**
     *
     */
    public Reader getReader(Path path) throws Exception;

    /**
     *
     */
    public InputStream getInputStream(Path path) throws Exception;

    /**
     *
     */
    public Reader getReader(Topic topic) throws Exception;

    /**
     *
     */
    public Writer getWriter(Path path);

    /**
     *
     */
    public Writer getWriter(Topic topic);

    /**
     *
     */
    public OutputStream getOutputStream(Path path);

    /**
     *
     */
    public long getLastModified(Path path);

    /**
     *
     */
    public boolean delete(Path path);
}

@@ -1484,32 +1484,46 @@
 %0A%0A    /**%0A     *
+ To write data
 %0A     */%0A    pub
@@ -1564,32 +1564,46 @@
 %0A%0A    /**%0A     *
+ To write data
 %0A     */%0A    pub
@@ -1640,32 +1640,231 @@
 am(Path path);%0A%0A
+    /**%0A     * To write data and allowing the resource to modify data during writing, e.g. %22updated%22 element of atom entry%0A     */%0A    public Path write(Path path, InputStream in) throws Exception;%0A%0A
     /**%0A     *%0A 

write method added to allow resource modifying data during writing