+
+ final List<File> files = Arrays.asList(schemasDir.listFiles());
+ for (final File file : files) {
+ final Matcher matcher = YANG_FILENAME_PATTERN.matcher(file.getName());
+ if (!matcher.matches()) {
+ final BufferedReader reader;
+ try {
+ reader = new BufferedReader(new FileReader(file));
+ String line = reader.readLine();
+ while (!DATE_PATTERN.matcher(line).find()) {
+ line = reader.readLine();
+ }
+ final Matcher m = DATE_PATTERN.matcher(line);
+
+ if (m.find()) {
+ String moduleName = file.getAbsolutePath();
+ if (file.getName().endsWith(".yang")) {
+ moduleName = moduleName.substring(0, moduleName.length() - 5);
+ }
+ final String revision = m.group(1);
+ final String correctName = moduleName + "@" + revision + ".yang";
+ final File correctNameFile = new File(correctName);
+ file.renameTo(correctNameFile);
+ }
+ } catch (final IOException e) {
+ // print error to console (test tool is running from console)
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ if (rpcConfig != null) {
+ checkArgument(rpcConfig.exists(), "Rpc config file has to exist");
+ checkArgument(!rpcConfig.isDirectory(), "Rpc config file can't be a directory");
+ checkArgument(rpcConfig.canRead(), "Rpc config file to be readable");