summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaeyoung Son <taeyoung2.son@samsung.com>2014-06-30 14:44:59 +0900
committerTaeyoung Son <taeyoung2.son@samsung.com>2014-07-04 15:21:31 +0900
commit6cbfc8aafbf2f1f910d19f5ab87ae905c5972f43 (patch)
tree66bf1f28c4a54dbb20a0262e1c58c5a438185d52
parentb165e615a5711af4e798fd93563c7bcb13669615 (diff)
downloadcommon-eplugin-6cbfc8aafbf2f1f910d19f5ab87ae905c5972f43.tar.gz
common-eplugin-6cbfc8aafbf2f1f910d19f5ab87ae905c5972f43.tar.bz2
common-eplugin-6cbfc8aafbf2f1f910d19f5ab87ae905c5972f43.zip
MISC: Added interface methods to ITizenNativeXMLStore
Removed checking duplicate directory process 1. Added interface methods to ITizenNativeXMLStore 2. Removed checking duplicate directory process Change-Id: I820a1828fd9ad385499862e5f99fe7a788623556 Signed-off-by: Taeyoung Son <taeyoung2.son@samsung.com>
-rw-r--r--org.tizen.common.packager/src/org/tizen/common/packager/core/PackageCommand.java11
-rw-r--r--org.tizen.common/src/org/tizen/common/ITizenNativeXMLStore.java11
2 files changed, 21 insertions, 1 deletions
diff --git a/org.tizen.common.packager/src/org/tizen/common/packager/core/PackageCommand.java b/org.tizen.common.packager/src/org/tizen/common/packager/core/PackageCommand.java
index 23da05c19..cbc145afb 100644
--- a/org.tizen.common.packager/src/org/tizen/common/packager/core/PackageCommand.java
+++ b/org.tizen.common.packager/src/org/tizen/common/packager/core/PackageCommand.java
@@ -1,6 +1,7 @@
package org.tizen.common.packager.core;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
@@ -82,7 +83,7 @@ public class PackageCommand extends FileHandlingCommand<Boolean> {
UserLogger.end( UserInteraction.CATE_WEB_PACKAGE, UserInteraction.BUILD_PACKAGING);
}
- private Collection<IResource> handleDuplicateFile(List<IResource> packageResources, ExecutionContext context) {
+ private Collection<IResource> handleDuplicateFile(List<IResource> packageResources, ExecutionContext context) throws IOException {
if (packageResources == null
|| packageResources.isEmpty()) {
return packageResources;
@@ -111,6 +112,10 @@ public class PackageCommand extends FileHandlingCommand<Boolean> {
for (int j=i+1; j<packageResources.size(); j++) {
IResource duplicateResource = packageResources.get(j);
if (getDestPath(packageResource).equals(getDestPath(duplicateResource))) {
+ if (isDirectory(packageResource) && isDirectory(duplicateResource)) {
+ resources.remove(duplicateResource);
+ continue;
+ }
RunnableOption resultOption = null;
if(selectedAllFlagOption == null) {
String overwriteFilePath = FileUtil.appendPath(duplicateResource.getFileHandler().getCurrentWorkingDirectory(), getDestPath(duplicateResource));
@@ -136,6 +141,10 @@ public class PackageCommand extends FileHandlingCommand<Boolean> {
return resources;
}
+ private boolean isDirectory(IResource resource) throws IOException {
+ return Type.DIRECTORY.equals(resource.getFileHandler().get(resource.getPath(), Attribute.TYPE));
+ }
+
private String getDestPath(IResource resource) {
if (resource instanceof PackageResource) {
return ((PackageResource) resource).getDestination();
diff --git a/org.tizen.common/src/org/tizen/common/ITizenNativeXMLStore.java b/org.tizen.common/src/org/tizen/common/ITizenNativeXMLStore.java
index e9d1909cc..7058dd019 100644
--- a/org.tizen.common/src/org/tizen/common/ITizenNativeXMLStore.java
+++ b/org.tizen.common/src/org/tizen/common/ITizenNativeXMLStore.java
@@ -62,6 +62,11 @@ public interface ITizenNativeXMLStore {
public boolean loadXml();
/**
+ * Parses xml files and loads.
+ */
+ public boolean loadXml(File file);
+
+ /**
* Merges app data.
* @param refAppXml - xml store app data of which is merged into this xml store.
*/
@@ -90,4 +95,10 @@ public interface ITizenNativeXMLStore {
public void setPackage(String packageId);
public void setVersion(String version);
+
+ /**
+ * Merges manifest file.
+ * @param refManifest - xml store of which is merged into this xml store.
+ */
+ public void mergeManifest(ITizenNativeXMLStore xmlStore);
}