/** * Gets a Path instance relative to the 'local' test (rather than the JBoss server context). * @param relativePath Relative path like <code>target/file.xml</code> * @param createParentDirectories If true, the parent directories of the path are created if necessary * @return Path relative to the unit test VM */ protected final Path getLocalPath(Path relativePath, boolean createParentDirectories) { Path localRoot = Paths.get(this.context.getLocalRoot()); Path localPath = localRoot.resolve(relativePath); if (createParentDirectories) { try { Files.createDirectories(localPath.getParent()); } catch (IOException ex) { throw new JuRuntimeException("Couldn't create parent directories", ex); } } return localPath; } }
/** * Gets a Path instance relative to the 'local' test (rather than the JBoss server context). * @param relativePath Relative path like <code>target/file.xml</code> * @param createParentDirectories If true, the parent directories of the path are created if necessary * @return Path relative to the unit test VM */ protected final Path getLocalPath(Path relativePath, boolean createParentDirectories) { Path localRoot = Paths.get(this.context.getLocalRoot()); Path localPath = localRoot.resolve(relativePath); if (createParentDirectories) { try { Files.createDirectories(localPath.getParent()); } catch (IOException ex) { throw new JuRuntimeException("Couldn't create parent directories", ex); } } return localPath; } }
@Override protected String getLocalRoot() { return this.getContext().getLocalRoot(); }
@Override protected String getLocalRoot() { return this.getContext().getLocalRoot(); }