Skip to content

Commit

Permalink
fixed: repeating an import adds the nodes and edges from the last imp…
Browse files Browse the repository at this point in the history
…ort to the new one
  • Loading branch information
bigbasti committed Mar 9, 2018
1 parent aa4c45c commit 6a01897
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public void parseInformation(Object data, Map<String, Object> params) throws For

logger.debug("data format accepted - begin parsing");

this.importedNodes = new ArrayList<>();
this.importedEdges = new ArrayList<>();
cleanSession();

parseAsLinks(strData);

logger.debug("parsing finished, parsed " + importedEdges.size() + " edges");
Expand Down Expand Up @@ -148,6 +148,11 @@ public ImportType getImportType() {
return ImportType.NODES_AND_EDGES;
}

private void cleanSession(){
this.importedEdges = new ArrayList<>();
this.importedNodes = new ArrayList<>();
}

@Override
public String toString() {
return "ASLinksEdgeImporter{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public Map<String, String> getAdditionalFields() {
public void parseInformation(Object data, Map<String, Object> params) throws FormatNotSupportedException {
logger.debug("starting import of data");

cleanSession();

checkIfAdditionalParamsSadisfied(params);

String strData = "";
Expand Down Expand Up @@ -355,6 +357,11 @@ private String getStringFromData(Object data) throws FormatNotSupportedException
return strData;
}

private void cleanSession(){
this.importedEdges = new ArrayList<>();
this.importedNodes = new ArrayList<>();
}

@Override
public String toString() {
return "ASLinksEdgeResolveGeoImporter{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public ImportType getImportType() {

public void parseInformation(Object data, Map<String, Object> params) throws FormatNotSupportedException {
logger.debug("starting import of data");
cleanSession();
checkIfAdditionalParamsSadisfied(params);

String strData = "";
Expand Down Expand Up @@ -230,6 +231,11 @@ private String getStringFromData(Object data) throws FormatNotSupportedException
return strData;
}

private void cleanSession(){
this.importedEdges = new ArrayList<>();
this.importedNodes = new ArrayList<>();
}

@Override
public String toString() {
return "ASLinksEdgeResolveImporter{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public ImportType getImportType() {
public void parseInformation(Object data, Map<String, Object> params) throws FormatNotSupportedException {
logger.debug("starting import of data");

cleanSession();

String strData = getStringFromData(data);

logger.debug("data format accepted - begin parsing");
Expand Down Expand Up @@ -127,6 +129,11 @@ private String getStringFromData(Object data) throws FormatNotSupportedException
return strData;
}

private void cleanSession(){
this.importedEdges = new ArrayList<>();
this.importedNodes = new ArrayList<>();
}

@Override
public String toString() {
return "CoriaDataSetImporter{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public ImportType getImportType() {

public void parseInformation(Object data, Map<String, Object> params) throws FormatNotSupportedException {
logger.debug("starting import of data");
cleanSession();

String strData = getStringFromData(data);

Expand Down Expand Up @@ -145,6 +146,11 @@ private String getStringFromData(Object data) throws FormatNotSupportedException
return strData;
}

private void cleanSession(){
this.importedEdges = new ArrayList<>();
this.importedNodes = new ArrayList<>();
}

@Override
public String toString() {
return "StandardTabImporter{" +
Expand Down

0 comments on commit 6a01897

Please sign in to comment.