@Override public String toString() { return getPathString(); }
public String getPath() { return relativePath.getPathString(); } public RelativePath getRelativePath() { return relativePath; }
public File getFile(File baseDir) { return new File(baseDir, getPathString()); }
public String getPath() { return getRelativePath().getPathString(); }
private void visitDir(FileCopyDetails dirDetails) { try { // Trailing slash in name indicates that entry is a directory ZipEntry archiveEntry = new ZipEntry(dirDetails.getRelativePath().getPathString() + '/'); archiveEntry.setTime(dirDetails.getLastModified()); zipOutStr.putNextEntry(archiveEntry); zipOutStr.closeEntry(); } catch (Exception e) { throw new GradleException(String.format("Could not add %s to ZIP '%s'.", dirDetails, zipFile), e); } } }
public void visitFile(FileVisitDetails fileDetails) { map.put(fileDetails.getRelativePath().getPathString(), fileDetails.getFile()); } });
@Override public void visitFile(FileVisitDetails details) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); details.copyTo(stream); // BAOS dont need to be clsoed. byte[] array = stream.toByteArray(); String path = details.getRelativePath().getPathString().replace('\\', '/'); if (details.getName().endsWith(".java")) { sourceMap.put(path, new String(array, Constants.CHARSET)); } else { resourceMap.put(path, array); } }
private void writeGzippedFile(FileCopyDetails fileDetails) { String path = fileDetails.getRelativePath().getPathString() + ".gz"; try { ZipEntry archiveEntry = new ZipEntry(path); archiveEntry.setTime(fileDetails.getLastModified()); zipOutStr.putNextEntry(archiveEntry); GZIPOutputStream out = new GZIPOutputStream(zipOutStr, true); fileDetails.copyTo(out); out.finish(); out.flush(); zipOutStr.closeEntry(); } catch (Exception e) { throw new GradleException(String.format("Could not add %s to ZIP '%s'.", path, zipFile), e); } }
private void writeOriginalFile(FileCopyDetails fileDetails) { String path = fileDetails.getRelativePath().getPathString(); try { ZipEntry archiveEntry = new ZipEntry(path); archiveEntry.setTime(fileDetails.getLastModified()); zipOutStr.putNextEntry(archiveEntry); fileDetails.copyTo(zipOutStr); zipOutStr.closeEntry(); } catch (Exception e) { throw new GradleException(String.format("Could not add %s to ZIP '%s'.", path, zipFile), e); } }
@Override public void visitClassFile(FileVisitDetails fileDetails) { String className = fileDetails.getRelativePath().getPathString().replaceAll("\\.class", "").replace('/', '.'); TestClassRunInfo testClass = new DefaultTestClassRunInfo(className); PluginTestClassScanner.this.testClassProcessor.processTestClass(testClass); } });
public void processFile(FileCopyDetailsInternal details) { File target = fileResolver.resolve(details.getRelativePath().getPathString()); boolean copied = details.copyTo(target); if (copied) { didWork = true; } } }
private void visitDir(FileCopyDetails dirDetails) { try { // Trailing slash on name indicates entry is a directory TarEntry archiveEntry = new TarEntry(dirDetails.getRelativePath().getPathString() + '/'); archiveEntry.setModTime(getArchiveTimeFor(dirDetails)); archiveEntry.setMode(UnixStat.DIR_FLAG | dirDetails.getMode()); tarOutStr.putNextEntry(archiveEntry); tarOutStr.closeEntry(); } catch (Exception e) { throw new GradleException(String.format("Could not add %s to TAR '%s'.", dirDetails, tarFile), e); } } }
private void visitDir(FileCopyDetails dirDetails) { try { // Trailing slash in name indicates that entry is a directory ZipEntry archiveEntry = new ZipEntry(dirDetails.getRelativePath().getPathString() + '/'); archiveEntry.setTime(getArchiveTimeFor(dirDetails)); archiveEntry.setUnixMode(UnixStat.DIR_FLAG | dirDetails.getMode()); zipOutStr.putNextEntry(archiveEntry); zipOutStr.closeEntry(); } catch (Exception e) { throw new GradleException(String.format("Could not add %s to ZIP '%s'.", dirDetails, zipFile), e); } } }
private void visitFile(FileCopyDetails fileDetails) { try { ZipEntry archiveEntry = new ZipEntry(fileDetails.getRelativePath().getPathString()); archiveEntry.setTime(getArchiveTimeFor(fileDetails)); archiveEntry.setUnixMode(UnixStat.FILE_FLAG | fileDetails.getMode()); zipOutStr.putNextEntry(archiveEntry); fileDetails.copyTo(zipOutStr); zipOutStr.closeEntry(); } catch (Exception e) { throw new GradleException(String.format("Could not add %s to ZIP '%s'.", fileDetails, zipFile), e); } }
File in = fileVisitDetails.getFile(); String pathString = fileVisitDetails.getRelativePath().getPathString();
File in = fileVisitDetails.getFile(); String pathString = fileVisitDetails.getRelativePath().getPathString();
CloudBlockBlob blob = container.getBlockBlobReference(uploadDir + fte.getRelativePath().getPathString()); blob.upload(new FileInputStream(fte.getFile()), fte.getSize());
private void visitFile(FileCopyDetails fileDetails) { try { TarEntry archiveEntry = new TarEntry(fileDetails.getRelativePath().getPathString()); archiveEntry.setModTime(getArchiveTimeFor(fileDetails)); archiveEntry.setSize(fileDetails.getSize()); archiveEntry.setMode(UnixStat.FILE_FLAG | fileDetails.getMode()); tarOutStr.putNextEntry(archiveEntry); fileDetails.copyTo(tarOutStr); tarOutStr.closeEntry(); } catch (Exception e) { throw new GradleException(String.format("Could not add %s to TAR '%s'.", fileDetails, tarFile), e); } }