| 1 | |
package org.webslinger.modules.edit; |
| 2 | |
|
| 3 | |
import java.io.InputStream; |
| 4 | |
import java.io.IOException; |
| 5 | |
|
| 6 | |
import org.apache.commons.fileupload.FileItem; |
| 7 | |
|
| 8 | |
import org.webslinger.servlet.Binary; |
| 9 | |
|
| 10 | |
public class EditorContextContent extends Binary.AbstractFileItemContent { |
| 11 | |
protected final Editor.Context context; |
| 12 | |
|
| 13 | 0 | public EditorContextContent(Editor.Context context) { |
| 14 | 0 | this.context = context; |
| 15 | 0 | } |
| 16 | |
|
| 17 | |
protected Editor.Context getContext() { |
| 18 | 0 | return context; |
| 19 | |
} |
| 20 | |
|
| 21 | |
protected FileItem getFileItem() { |
| 22 | 0 | return getContext().getContent(); |
| 23 | |
} |
| 24 | |
|
| 25 | |
public long getLastModifiedTime() throws IOException { |
| 26 | 0 | return getContext().getLastModifiedTime(); |
| 27 | |
} |
| 28 | |
|
| 29 | |
public String getContentType() throws IOException { |
| 30 | 0 | return getContext().getContentType(); |
| 31 | |
} |
| 32 | |
|
| 33 | |
public String getContentEncoding() throws IOException { |
| 34 | 0 | return getContext().getContentEncoding(); |
| 35 | |
} |
| 36 | |
|
| 37 | |
public boolean exists() throws IOException { |
| 38 | 0 | return getContext().exists(); |
| 39 | |
} |
| 40 | |
} |