Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: s IT Solutions AT Spardat GmbH - initial API and implementation /
 
 
 /*
  * Created on 16.05.2003
  */
 package at.spardat.xma.boot.transport;
 
Result-objects are used by the transport layer, to store server request results. it contains the result buffer and additional information about the resource.

Author(s):
s2877, s3595
Version:
$Id: Result.java 2084 2007-11-27 14:53:31Z s3460 $
 
 public class Result {

    
if the server returns an expiration date for the resource, it is stored in this member. the default is 0.
 
     long        expirationDate_;

    
the last modified information returned from server.
 
     long        lastModified_;

    
the length of the content returned from the server in bytes. this is equal to the buffer length.
 
     int         contentLength_;

    
the ETag is used in combination with conditional gets from the server.
 
     String      etag_;

    
list of transforming filters applied at the server side (e.g. compression, hash)
 
     String      transformations_;

    
buffer that contains the server result as byte array.
 
     byte[]             buffer_;

    
initialize members
 
     public Result() {
          = 0L;
            = 0L;
           = 0;
                  = null;
                    = null;
          = null;
     }

    
get an InputStream to read the resource.

Returns:
InputStream returns an input stream to the result buffer.
 
     public InputStream getContent() {
         if(!=null) {
             return new ByteArrayInputStream();
         } else {
             throw new IllegalStateException"result buffer is not initialized"); //$NON-NLS-1$
         }
     }

    
Get the ETag which is used for conditional gets from the server.

Returns:
String etag value
 
     public String getEtag() {
         return ;
     }

    
Does this result object contain a modified resource loaded from server ?

Returns:
true if the resource contains new data.
 
     public boolean isModified() {
         return  != null;
     }

    
Gets the length of the content returned from the server in bytes.

Returns:
contentLength buffer length
    public int getContentLength() {
        return ;
    }

    
Gets the expiration date of the resource as returned by the server.

Returns:
long the expiration date or 0 if no expiration date was returned by the server.
    public long getExpirationDate() {
        return ;
    }

    
Gets the the last modified information returned from the server.

Returns:
long last modified
    public long getLastModified() {
        return ;
    }

    
Get the buffer containing the content data returned from the server.

Returns:
byte[] buffer
    public byte[] getBuffer() {
        return ;
    }

    
Sets the buffer containing the data returned from the server. This method my only be called by an implementation of Transport.

Parameters:
bs buffer
    void setBuffer(byte[] bs) {
         = bs;
    }

    
Get the descripton of the list of transforming filters applied at the server side (e.g. compression, hash)

Since:
1.3.0
See also:
at.spardat.xma.session.Transform
    public String getTransformations() {
        return ;
    }
New to GrepCode? Check out our FAQ X