@Override public InputStream getInputStream() throws IOException { return resource.getObject().getInputStream(); }
@Override public InputStream getInputStream() throws IOException { return resource.getObject().getInputStream(); }
@Override public long updateResource(File file, Resource resource) throws IOException { File parent = file.getParentFile(); if (parent != null) { if (!parent.exists()) { if (!parent.mkdirs()) { throw new IOException("Could not create parent directory " + parent.getCanonicalPath()); } } } InputStream in = resource.getInputStream(); FileOutputStream out = new FileOutputStream(file); try { Tools.copy(in, out); } finally { Tools.safeClose(out); } return file.lastModified(); }
@Override public long updateResource(File file, Resource resource) throws IOException { File parent = file.getParentFile(); if (parent != null) { if (!parent.exists()) { if (!parent.mkdirs()) { throw new IOException("Could not create parent directory " + parent.getCanonicalPath()); } } } InputStream in = resource.getInputStream(); FileOutputStream out = new FileOutputStream(file); try { Tools.copy(in, out); } finally { Tools.safeClose(out); } return file.lastModified(); }
public final InputStream openInputStream() throws IOException { return assertContent().getObject().getInputStream(); }
public final InputStream openInputStream() throws IOException { return assertContent().getObject().getInputStream(); }
@Override protected long stampOf(P file) throws IOException { juzu.impl.common.Timestamped<Resource> resource = fs.getResource(file); InputStream in = resource.getObject().getInputStream(); byte[] bytes = Tools.bytes(in); return Tools.md5(bytes); }
@Override protected long stampOf(P file) throws IOException { juzu.impl.common.Timestamped<Resource> resource = fs.getResource(file); InputStream in = resource.getObject().getInputStream(); byte[] bytes = Tools.bytes(in); return Tools.md5(bytes); }
public CompilationUnit assertCompilationUnit() { if (cu == null) { try { Resource content = sourcePath.getResource(path).getObject(); InputStream in = content.getInputStream(); cu = JavaParser.parse(in); } catch (Exception e) { throw AbstractTestCase.failure(e); } } return cu; }
public CompilationUnit assertCompilationUnit() { if (cu == null) { try { Resource content = sourcePath.getResource(path).getObject(); InputStream in = content.getInputStream(); cu = JavaParser.parse(in); } catch (Exception e) { throw AbstractTestCase.failure(e); } } return cu; }