Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * 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.sling.api.request;
 
 
 public interface RequestParameter {

    
Determines whether or not this instance represents a simple form field or an uploaded file.

Returns:
true if the instance represents a simple form field; false if it represents an uploaded file.
 
     boolean isFormField();

    
Returns the content type passed by the browser or null if not defined.

Returns:
The content type passed by the browser or null if not defined.
 
     String getContentType();

    
Returns the size in bytes of the parameter.

Returns:
The size in bytes of the parameter.
 
     long getSize();

    
Returns the contents of the parameter as an array of bytes.

Returns:
The contents of the parameter as an array of bytes.
 
     byte[] get();

    
Returns an InputStream that can be used to retrieve the contents of the file.

Returns:
An InputStream that can be used to retrieve the contents of the file.
Throws:
java.io.IOException if an error occurs.
 
     InputStream getInputStream() throws IOException;

    
Returns the original filename in the client's filesystem, as provided by the browser (or other client software). In most cases, this will be the base file name, without path information. However, some clients, such as the Opera browser, do include path information.

Returns:
The original filename in the client's filesystem.
 
     String getFileName();

    
Returns the contents of the parameter as a String, using the default character encoding. This method uses get() to retrieve the contents of the item.

Returns:
The contents of the parameter, as a string.
 
     String getString();

    
Returns the contents of the parameter as a String, using the specified encoding. This method uses link get() to retrieve the contents of the item.

Parameters:
encoding The character encoding to use.
Returns:
The contents of the parameter, as a string.
Throws:
java.io.UnsupportedEncodingException if the requested character encoding is not available.
New to GrepCode? Check out our FAQ X