Hello all,

I am just getting started with Slide. I have been developing in Java
for a few years but I am
having some trouble understanding what exactly is happening when a
checkout is performed in Slide.

Would anyone provide an example of how a client (maybe jsp for
instance) can checkout a file from a Slide server and possibly provide
a brief description of how the Slide server handles the process.

I would very greatly appreciate any help that anyone could provide.

Thanks,
Mike



On 13 Dec 2004 16:50:21 -0000, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> ozeigermann    2004/12/13 08:50:21
> 
>   Modified:    src/share/org/apache/slide/content NodeRevisionContent.java
>   Log:
>   Added means to resuse streams by buffering them to a temporary file.
> 
>   Revision  Changes    Path
>   1.17      +29 -5     
> jakarta-slide/src/share/org/apache/slide/content/NodeRevisionContent.java
> 
>   Index: NodeRevisionContent.java
>   ===================================================================
>   RCS file: 
> /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionContent.java,v
>   retrieving revision 1.16
>   retrieving revision 1.17
>   diff -u -r1.16 -r1.17
>   --- NodeRevisionContent.java  28 Jul 2004 09:37:55 -0000      1.16
>   +++ NodeRevisionContent.java  13 Dec 2004 16:50:21 -0000      1.17
>   @@ -23,11 +23,17 @@
> 
>    package org.apache.slide.content;
> 
>   +import java.io.BufferedInputStream;
>   +import java.io.BufferedOutputStream;
>    import java.io.ByteArrayInputStream;
>    import java.io.CharArrayReader;
>   +import java.io.File;
>   +import java.io.FileInputStream;
>   +import java.io.FileOutputStream;
>    import java.io.IOException;
>    import java.io.InputStream;
>    import java.io.InputStreamReader;
>   +import java.io.OutputStream;
>    import java.io.Reader;
>    import java.io.Serializable;
>    import java.util.ArrayList;
>   @@ -36,6 +42,8 @@
>    import org.apache.slide.common.ObjectValidationFailedException;
>    import org.apache.slide.util.Messages;
> 
>   +import org.apache.commons.transaction.util.FileHelper;
>   +
>    /**
>     * Encapsultes the contents of a revision.
>     *
>   @@ -284,7 +292,23 @@
>            this.contentBytes = null;
>        }
> 
>   -
>   +    public long bufferContent(InputStream is) throws IOException {
>   +        File buffer = File.createTempFile("content_", null);
>   +        OutputStream os = new BufferedOutputStream(new 
> FileOutputStream(buffer));
>   +        try {
>   +            long length = FileHelper.globalBufferCopy(is, os);
>   +            InputStream bis = new BufferedInputStream(new 
> FileInputStream(buffer));
>   +            setContent(bis);
>   +            return length;
>   +        } finally {
>   +            try {
>   +                is.close();
>   +            } finally {
>   +                os.close();
>   +            }
>   +        }
>   +    }
>   +
>        // TODO : Add real serialization support
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to