if (src.exists()) {
ds = new SourceDataSource(src, getType(), getName());
}
} else if (getObject() instanceof Part) {
Part part = (Part) getObject();
ds = new FilePartDataSource(part, getType(), getName());
} else if (getObject() instanceof InputStream) {
InputStream in = (InputStream) getObject();
ds = new InputStreamDataSource(in, getType(), getName());
} else if (getObject() instanceof byte[]) {
byte[] data = (byte[]) getObject();