@@ -82,7 +82,6 @@ private void renameDocument(
8282 List <String > filesWithUnsupportedProperties = new ArrayList <>();
8383 Map <String , String > badRequest = new HashMap <>();
8484 Map <String , String > propertyTitles = new HashMap <>();
85- List <String > fileWithWhiteSpace = new ArrayList <>();
8685 List <String > noSDMRoles = new ArrayList <>();
8786 for (Map <String , Object > entity : data ) {
8887 List <Map <String , Object >> attachments = (List <Map <String , Object >>) entity .get (composition );
@@ -110,8 +109,7 @@ private void renameDocument(
110109 filesWithUnsupportedProperties ,
111110 badRequest ,
112111 secondaryPropertiesWithInvalidDefinitions ,
113- noSDMRoles ,
114- fileWithWhiteSpace );
112+ noSDMRoles );
115113 }
116114 }
117115 handleWarnings (
@@ -122,8 +120,7 @@ private void renameDocument(
122120 filesWithUnsupportedProperties ,
123121 badRequest ,
124122 propertyTitles ,
125- noSDMRoles ,
126- fileWithWhiteSpace );
123+ noSDMRoles );
127124 }
128125
129126 private void processAttachments (
@@ -136,8 +133,7 @@ private void processAttachments(
136133 List <String > filesWithUnsupportedProperties ,
137134 Map <String , String > badRequest ,
138135 Map <String , String > secondaryPropertiesWithInvalidDefinitions ,
139- List <String > noSDMRoles ,
140- List <String > fileWithWhiteSpace )
136+ List <String > noSDMRoles )
141137 throws IOException {
142138 Iterator <Map <String , Object >> iterator = attachments .iterator ();
143139 while (iterator .hasNext ()) {
@@ -152,8 +148,7 @@ private void processAttachments(
152148 filesWithUnsupportedProperties ,
153149 badRequest ,
154150 secondaryPropertiesWithInvalidDefinitions ,
155- noSDMRoles ,
156- fileWithWhiteSpace );
151+ noSDMRoles );
157152 }
158153 SecondaryPropertiesKey secondaryPropertiesKey = new SecondaryPropertiesKey ();
159154 secondaryPropertiesKey .setRepositoryId (SDMConstants .REPOSITORY_ID );
@@ -173,8 +168,7 @@ public void processAttachment(
173168 List <String > filesWithUnsupportedProperties ,
174169 Map <String , String > badRequest ,
175170 Map <String , String > secondaryPropertiesWithInvalidDefinitions ,
176- List <String > noSDMRoles ,
177- List <String > fileWithWhiteSpace )
171+ List <String > noSDMRoles )
178172 throws IOException {
179173 String id = (String ) attachment .get ("ID" );
180174 Map <String , String > secondaryTypeProperties =
@@ -228,10 +222,8 @@ public void processAttachment(
228222 throw new ServiceException ("Filename cannot be empty" );
229223 }
230224 } else {
231- if (filenameInRequest == null || filenameInRequest .trim ().length () == 0 ) {
232- fileWithWhiteSpace .add (fileNameInDB );
233- replacePropertiesInAttachment (
234- attachment , fileNameInDB , propertiesInDB , secondaryTypeProperties );
225+ if (filenameInRequest == null ) {
226+ throw new ServiceException ("Filename cannot be empty" );
235227 } else if (!fileNameInDB .equals (filenameInRequest )) {
236228 updatedSecondaryProperties .put ("filename" , filenameInRequest );
237229 }
@@ -321,8 +313,7 @@ private void handleWarnings(
321313 List <String > filesWithUnsupportedProperties ,
322314 Map <String , String > badRequest ,
323315 Map <String , String > propertyTitles ,
324- List <String > noSDMRoles ,
325- List <String > fileWithWhiteSpace ) {
316+ List <String > noSDMRoles ) {
326317 if (!fileNameWithRestrictedCharacters .isEmpty ()) {
327318 context
328319 .getMessages ()
@@ -362,14 +353,6 @@ private void handleWarnings(
362353 if (!noSDMRoles .isEmpty ()) {
363354 context .getMessages ().warn (SDMConstants .noSDMRolesMessage (noSDMRoles , "update" ));
364355 }
365- if (!fileWithWhiteSpace .isEmpty ()) {
366- context
367- .getMessages ()
368- .warn (
369- String .format (
370- SDMConstants .FILENAME_WHITESPACE_WARNING_MESSAGE ,
371- String .join (", " , fileWithWhiteSpace )));
372- }
373356 }
374357
375358 private List <String > getEntityCompositions (CdsUpdateEventContext context ) {
0 commit comments