private String getTopicName()

in src/main/java/com/aliyun/mns/client/CloudTopic.java [127:146]


    private String getTopicName() {
        String topicName = null;
        if (topicURL.startsWith(this.endpoint.toString())) {
            topicName = topicURL
                .substring(this.endpoint.toString().length() + 1 + MNSConstants.TOPIC_PREFIX.length());
        }

        // erase start "/"
        while (topicName != null && !topicName.trim().isEmpty()
            && topicName.startsWith("/")) {
            topicName = topicName.substring(1);
        }

        if (topicName == null || topicName.trim().isEmpty()) {
            logger.warn("topic name is null or empty");
            throw new NullPointerException("Topic Name can not be null.");
        }

        return topicName;
    }