de.espirit.firstspirit.server.mediamanagement
Interface UploadFilter

All Superinterfaces:
Closeable
All Known Implementing Classes:
FileBasedUploadFilter

public interface UploadFilter
extends Closeable


Method Summary
 void close()
          Callback method which may be used to do some clean up.
 void initUploadFilter(InputStream in, String extension)
          Initialize the filter instance.
 int read(byte[] b, int off, int len)
          See InputStream.read(byte[], int, int).
 

Method Detail

initUploadFilter

void initUploadFilter(@NotNull
                      InputStream in,
                      @NotNull
                      String extension)
                      throws IOException
Initialize the filter instance. It is not allowed to change the content of the data provided by in.

Parameters:
in - input stream containing the data
extension - file extension - it is not save to guess the file content from this extension
Throws:
IOException

read

int read(@NotNull
         byte[] b,
         int off,
         int len)
         throws IOException
See InputStream.read(byte[], int, int).

Throws:
IOException

close

void close()
Callback method which may be used to do some clean up. A call to this method should at least close the input stream provided in method UploadFilter.initUploadFilter(java.io.InputStream, String).

Specified by:
close in interface Closeable


Copyright © 2012 e-Spirit AG. All Rights Reserved. Build 4.2.480