org.apache.clerezza.triaxrs.providers.provided
Class FileProvider

java.lang.Object
  extended by org.apache.clerezza.triaxrs.providers.provided.FileProvider
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<File>, javax.ws.rs.ext.MessageBodyWriter<File>

@Provider
public class FileProvider
extends Object
implements javax.ws.rs.ext.MessageBodyWriter<File>, javax.ws.rs.ext.MessageBodyReader<File>


Constructor Summary
FileProvider()
           
 
Method Summary
 String getPrefix()
          getters & setters
 long getSize(File t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
          Writer
 String getSuffix()
           
 String getUploadDir()
           
 boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
          Reader
 boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 File readFrom(Class<File> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
           
 void setPrefix(String prefix)
          set the prefix of the uploaded files
 void setSuffix(String suffix)
          set the suffix of the uploaded files
 void setUploadDir(String uploadDir)
          set the directory where this provider save the upload files
 void writeTo(File t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileProvider

public FileProvider()
Method Detail

getSize

public long getSize(File t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType)
Writer

Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<File>

isWriteable

public boolean isWriteable(Class<?> type,
                           Type genericType,
                           Annotation[] annotations,
                           javax.ws.rs.core.MediaType mediaType)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<File>

writeTo

public void writeTo(File t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
                    OutputStream entityStream)
             throws IOException,
                    javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<File>
Throws:
IOException
javax.ws.rs.WebApplicationException

isReadable

public boolean isReadable(Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          javax.ws.rs.core.MediaType mediaType)
Reader

Specified by:
isReadable in interface javax.ws.rs.ext.MessageBodyReader<File>

readFrom

public File readFrom(Class<File> type,
                     Type genericType,
                     Annotation[] annotations,
                     javax.ws.rs.core.MediaType mediaType,
                     javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
                     InputStream entityStream)
              throws IOException,
                     javax.ws.rs.WebApplicationException
Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader<File>
Throws:
IOException
javax.ws.rs.WebApplicationException

getPrefix

public String getPrefix()
getters & setters


setPrefix

public void setPrefix(String prefix)
set the prefix of the uploaded files


getUploadDir

public String getUploadDir()

setUploadDir

public void setUploadDir(String uploadDir)
set the directory where this provider save the upload files

Parameters:
uploadDir -

getSuffix

public String getSuffix()

setSuffix

public void setSuffix(String suffix)
set the suffix of the uploaded files



Copyright © 2012 The Apache Software Foundation. All Rights Reserved.