Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • dad/cines-vitamui
1 result
Show changes
......@@ -28,42 +28,15 @@
package fr.gouv.vitamui.pastis.model.profiles;
import fr.gouv.vitamui.pastis.model.ElementProperties;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ProfileResponse {
Long id;
String name;
ElementProperties profile;
Notice notice;
String type;
public ElementProperties getProfile() {
return profile;
}
public void setProfile(ElementProperties profile) {
this.profile = profile;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Notice getNotice() {
return notice;
}
public void setNotice(Notice notice) {
this.notice = notice;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
......@@ -221,6 +221,7 @@ public class ProfileService {
profileResponse.setId(profileToEdit.getId());
profileResponse.setType(profileToEdit.getType());
profileResponse.setName(profileToEdit.getBaseName());
if (profileResponse.getType().equals("PA")) {
XMLReader xmlReader = XMLReaderFactory.createXMLReader();
......@@ -254,7 +255,10 @@ public class ProfileService {
try {
String fileExtension = file.getOriginalFilename().split("\\.")[1];
String profileName = file.getOriginalFilename().split("\\.(?=[^\\.]+$)")[0];
profileResponse.setType(fileExtension.equals("rng") ? "PA":"PUA");
profileResponse.setName(profileName);
InputStream fileInputStream = file.getInputStream();
InputSource inputSource = new InputSource(file.getInputStream());
......