mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 21:57:56 +01:00
Increase number of nodes supported.
This commit is contained in:
parent
ba80f9479c
commit
c3be0b6552
@ -44,8 +44,8 @@ public class InvalidMindmapException
|
||||
return new InvalidMindmapException(INVALID_MINDMAP_FORMAT, xmlDoc);
|
||||
}
|
||||
|
||||
static public InvalidMindmapException tooBigMindnap() {
|
||||
return new InvalidMindmapException(TOO_BIG_MINDMAP,"<too-big>");
|
||||
static public InvalidMindmapException tooBigMindnap(int numberOfTopics) {
|
||||
return new InvalidMindmapException(TOO_BIG_MINDMAP, "<too-big " + numberOfTopics + ">");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
abstract public class MindmapUtils {
|
||||
|
||||
private static final int MAX_SUPPORTED_NODES = 500;
|
||||
private static final int MAX_SUPPORTED_NODES = 1000;
|
||||
|
||||
public static void verifyMindmap(@Nullable String xmlDoc) throws InvalidMindmapException {
|
||||
if (xmlDoc == null || xmlDoc.trim().isEmpty()) {
|
||||
@ -20,8 +20,9 @@ abstract public class MindmapUtils {
|
||||
}
|
||||
|
||||
// Validate that the number of nodes is not bigger 500 nodes.
|
||||
if (xmlDoc.split("<topic").length > MAX_SUPPORTED_NODES) {
|
||||
throw InvalidMindmapException.tooBigMindnap();
|
||||
int numberOfTopics = xmlDoc.split("<topic").length;
|
||||
if (numberOfTopics > MAX_SUPPORTED_NODES) {
|
||||
throw InvalidMindmapException.tooBigMindnap(numberOfTopics);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user