FileInfo.Relation: 필수 -> 선택

master
mjkhan21 1 year ago
parent d0d65ce27e
commit 165fdcce4b

@ -98,8 +98,12 @@ public class FileInfo extends AbstractEntity {
* @param fileInfo FileInfo
*/
public void setInfo(FileInfo fileInfo) {
fileInfo.setInfoType(infoType);
fileInfo.setInfoKey(infoKey);
/*
fileInfo.setInfoType(Assert.notEmpty(infoType, "infoType"));
fileInfo.setInfoKey(Assert.notEmpty(infoKey, "infoKey"));
*/
fileInfo.setSubType(subType);
}
}
@ -190,6 +194,7 @@ public class FileInfo extends AbstractEntity {
if (file == null) continue;
FileInfo info = new FileInfo();
if (relation != null)
relation.setInfo(info);
String filename = file.getName();
info.setName(filename);
@ -240,7 +245,9 @@ public class FileInfo extends AbstractEntity {
if (holder == null) continue;
FileInfo info = new FileInfo();
holder.getRelation().setInfo(info);
Relation relation = holder.getRelation();
if (relation != null)
relation.setInfo(info);
String filename = holder.getFilename();
info.setName(filename);
InputStream input = new ByteArrayInputStream(holder.data);

@ -33,6 +33,7 @@ public class FileInfoFactory extends FileInfo.Factory {
info.setSize(file.getSize());
info.setInputStream(file.getInputStream());
info.setSortOrder(result.size());
if (relation != null)
relation.setInfo(info);
result.add(info);
} catch (Exception e) {

Loading…
Cancel
Save