Skip to content

Commit

Permalink
Merge pull request #25 from SmartBear/ZEPHYR-27185
Browse files Browse the repository at this point in the history
revert
  • Loading branch information
pv-smartbear committed Mar 30, 2020
2 parents 41e446e + 0c2a161 commit 2bd4e72
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main/java/com/thed/service/impl/AttachmentServiceImpl.java
Expand Up @@ -32,15 +32,7 @@ public void addAttachments(ItemType itemType, Map<Long, List<String>> itemIdFile
for (String filePath : attachmentFilePaths) {

Path path = Paths.get(filePath);
// remove special character from filename
String fileName = path.getFileName().toString().replaceAll("[\\\\/:*?\"<>|]", "");
int length = fileName.substring(0,fileName.lastIndexOf(".")).length();
if(length > 240) {
String extension = fileName.substring(fileName.lastIndexOf("."));
fileName = fileName.substring(0, 240);
fileName += extension;
}

String fileName = path.getFileName().toString();
String mimeType = Files.probeContentType(path);
byte[] bytes = Files.readAllBytes(Paths.get(filePath));

Expand Down

0 comments on commit 2bd4e72

Please sign in to comment.