Merge remote-tracking branch 'origin/maintenance/8.0' into jzhang/80/TUP-38828

This commit is contained in:
jiezhang-tlnd
2024-01-19 11:28:26 +08:00
5 changed files with 8 additions and 6 deletions

View File

@@ -856,13 +856,13 @@ public class XmiResourceManager {
URI orgPropertyResourceURI = EcoreUtil.getURI(originalItem.getProperty());
URI orgRelativePlateformDestUri = orgPropertyResourceURI.trimFileExtension().appendFileExtension(
FileConstants.SCREENSHOT_EXTENSION);
URL orgFileURL = FileLocator.toFileURL(new java.net.URL(
URL orgFileURL = FileLocator.resolve(new java.net.URL(
"platform:/resource" + orgRelativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
URI newPropertyResourceURI = EcoreUtil.getURI(newItem.getProperty());
URI newRelativePlateformDestUri = newPropertyResourceURI.trimFileExtension().appendFileExtension(
FileConstants.SCREENSHOT_EXTENSION);
URL newFileURL = FileLocator.toFileURL(new java.net.URL(
URL newFileURL = FileLocator.resolve(new java.net.URL(
"platform:/resource" + newRelativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
os = new FileOutputStream(newFileURL.getFile());

View File

@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.CoreException;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
@@ -41,6 +42,7 @@ import org.talend.repository.model.IRepositoryNode;
*
*/
public class ExportFileResource {
private static Logger LOGGER = Logger.getLogger(ExportFileResource.class);
private Item item;
@@ -101,7 +103,7 @@ public class ExportFileResource {
String decodeStr = URLDecoder.decode(url.toString(), "UTF-8"); //$NON-NLS-1$
url = new URL(decodeStr);
} catch (Exception e) {
e.printStackTrace(); // only for debug.
LOGGER.warn(e);
}
return url;

View File

@@ -97,7 +97,7 @@ public final class HandlerUtil {
URI propertyResourceURI = EcoreUtil.getURI(itemRecord.getItem().getProperty());
URI relativePlateformDestUri = propertyResourceURI.trimFileExtension().appendFileExtension(
FileConstants.SCREENSHOT_EXTENSION);
URL fileURL = FileLocator.toFileURL(new java.net.URL(
URL fileURL = FileLocator.resolve(new java.net.URL(
"platform:/resource" + relativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
// for migration task ,there is not .screeenshot file in preceding version - begin
boolean hasScreenshotFile = false;

View File

@@ -1117,7 +1117,7 @@ public class ImportBasicHandler extends AbstractImportExecutableHandler {
haveRef = true;
URI relativePlateformDestUri = getReferenceFileURI(propertyResourceURI, refItem);
try {
URL fileURL = FileLocator.toFileURL(new java.net.URL(
URL fileURL = FileLocator.resolve(new java.net.URL(
"platform:/resource" + relativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
os = new FileOutputStream(fileURL.getFile());
is = manager.getStream(getReferenceItemPath(selectedImportItem.getPath(), refItem), selectedImportItem);

View File

@@ -90,7 +90,7 @@ public class MetadataConnectionImportHandler extends ImportRepTypeHandler {
URI propertyResourceURI = EcoreUtil.getURI(((ConnectionItem) tmpItem).getProperty());
URI relativePlateformDestUri = propertyResourceURI.trimFileExtension().appendFileExtension(
FileConstants.ITEM_EXTENSION);
URL fileURL = FileLocator.toFileURL(new java.net.URL(
URL fileURL = FileLocator.resolve(new java.net.URL(
"platform:/resource" + relativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
OutputStream os = new FileOutputStream(fileURL.getFile());
try {