SimpleContext.java
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.dam.api.Context
* com.day.cq.dam.api.ProcessorException
*/
package com.day.cq.dam.commons.handler;
import com.day.cq.dam.api.Context;
import com.day.cq.dam.api.ProcessorException;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class SimpleContext
implements Context {
private List<InputStream> metas;
private List<BufferedImage> thumbnails;
private List<ProcessorException> exceptions;
public InputStream[] getMetadata() {
if (this.metas != null) {
return this.metas.toArray(new InputStream[0]);
}
return null;
}
public BufferedImage[] getThumbnails() {
if (this.thumbnails != null) {
return this.thumbnails.toArray(new BufferedImage[0]);
}
return null;
}
public ProcessorException[] getExceptions() {
if (this.exceptions != null) {
return this.exceptions.toArray((T[])new ProcessorException[0]);
}
return null;
}
public void addException(ProcessorException e) {
if (this.exceptions == null) {
this.exceptions = new ArrayList<ProcessorException>();
}
this.exceptions.add(e);
}
public void addMetadata(InputStream meta) {
if (this.metas == null) {
this.metas = new ArrayList<InputStream>();
}
this.metas.add(meta);
}
public void addThumbnail(BufferedImage image) {
if (this.thumbnails == null) {
this.thumbnails = new ArrayList<BufferedImage>();
}
this.thumbnails.add(image);
}
}