class ApiRepoPathReader {

	public List<String> validate(String name) {
		this.name = name;
		
		List<String> errors = new ArrayList<String>();
		
		// 去掉后缀名
		String stripedName = org.springframework.util.StringUtils.stripFilenameExtension(name);
		
		String[] array = stripedName.split(SEPARATOR);
		if(array.length == 1) {
			String order = array[0];
			try {
				LocalDateTime.parse(order, DateTimeFormatter.ofPattern("yyyyMMddHHmm"));
				
				pathInfo = new ApiRepoPathInfo(array[0], null);
			}catch(DateTimeParseException e) {
				errors.add(order + "应该是格式为 yyyyMMddHHmm 的时间");
			}
		}else if(array.length >=2 ) {
			String order = array[0];
			try {
				LocalDateTime.parse(order, DateTimeFormatter.ofPattern("yyyyMMddHHmm"));
				
				String[] left = Arrays.copyOfRange(array, 1, array.length);
				pathInfo = new ApiRepoPathInfo(array[0], String.join(SEPARATOR, left));
			}catch(DateTimeParseException e) {
				errors.add(order + "应该是格式为 yyyyMMddHHmm 的时间");
			}
		}
		return errors;
	}

}