Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import lombok.extern.slf4j.Slf4j;
import org.sakaiproject.content.api.ContentResource;
Expand Down Expand Up @@ -59,13 +57,6 @@ public ContentResource createContentResource(String fullFilePath, String filenam
int count = 0;

try {
try{
fullFilePath = URLDecoder.decode(fullFilePath, "UTF-8");
filename = URLDecoder.decode(filename, "UTF-8");
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage());
}

if (mimeType.equalsIgnoreCase("text/url")) {
content = filename.getBytes();
filename = filename.replaceAll("http://","http:__");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
package org.sakaiproject.tool.assessment.qti.helper;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
Expand Down Expand Up @@ -1272,8 +1274,15 @@ public String makeFCKAttachment(String text) {
// oldSplittedResourceId[3] = Blue Hill.jpg
endIndex = splittedString[i].indexOf("\"",splittedString[i].indexOf("\"")+1);
oldResourceId = splittedString[i].substring(splittedString[i].indexOf("\"")+1, endIndex);
try {
oldResourceId = URLDecoder.decode(oldResourceId, "UTF-8");
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage());
}

oldResourceId = StringUtils.replace(oldResourceId, " ", "");
String[] oldSplittedResourceId = oldResourceId.split("/");
fullFilePath = unzipLocation + "/" + oldResourceId.replace(" ", "");
fullFilePath = unzipLocation + "/" + oldResourceId;
filename = oldSplittedResourceId[oldSplittedResourceId.length - 1];
MimetypesFileTypeMap mimetypesFileTypeMap = new MimetypesFileTypeMap();
contentType = mimetypesFileTypeMap.getContentType(filename);
Expand Down
Loading