if (filterCommand != null) { if (FilterCommandRegistry.isRegistered(filterCommand)) { LocalFile buffer = new TemporaryBuffer.LocalFile(null); FilterCommand command = FilterCommandRegistry .createFilterCommand(filterCommand, repository, in,
private TemporaryBuffer doMerge(MergeResult<RawText> result) throws IOException { TemporaryBuffer.LocalFile buf = new TemporaryBuffer.LocalFile( db != null ? nonNullRepo().getDirectory() : null, inCoreLimit); try { new MergeFormatter().formatMerge(buf, result, Arrays.asList(commitNames), UTF_8); buf.close(); } catch (IOException e) { buf.destroy(); throw e; } return buf; }
@SuppressWarnings("resource") // Explicitly closed in try block, and TemporaryBuffer bb = new TemporaryBuffer.LocalFile(dir, 5 << 20); try { tree.write(tmp, bb);
/** * Execute a command defined by a {@link ProcessBuilder}. * * @param pb * The command to be executed * @param in * The standard input stream passed to the process * @return The result of the executed command * @throws InterruptedException * @throws IOException * @since 4.2 */ public ExecutionResult execute(ProcessBuilder pb, InputStream in) throws IOException, InterruptedException { TemporaryBuffer stdout = new TemporaryBuffer.LocalFile(null); TemporaryBuffer stderr = new TemporaryBuffer.Heap(1024, 1024 * 1024); try { int rc = runProcess(pb, stdout, stderr, in); return new ExecutionResult(stdout, stderr, rc); } finally { stdout.close(); stderr.close(); } }
/** * Execute a command defined by a {@link java.lang.ProcessBuilder}. * * @param pb * The command to be executed * @param in * The standard input stream passed to the process * @return The result of the executed command * @throws java.lang.InterruptedException * @throws java.io.IOException * @since 4.2 */ public ExecutionResult execute(ProcessBuilder pb, InputStream in) throws IOException, InterruptedException { try (TemporaryBuffer stdout = new TemporaryBuffer.LocalFile(null); TemporaryBuffer stderr = new TemporaryBuffer.Heap(1024, 1024 * 1024)) { int rc = runProcess(pb, stdout, stderr, in); return new ExecutionResult(stdout, stderr, rc); } }
private ObjectId insertMergeResult(MergeResult<RawText> result) throws IOException { TemporaryBuffer.LocalFile buf = new TemporaryBuffer.LocalFile( db.getDirectory(), 10 << 20); try { new MergeFormatter().formatMerge(buf, result, Arrays.asList(commitNames), CHARACTER_ENCODING); buf.close(); try (InputStream in = buf.openInputStream()) { return getObjectInserter().insert(OBJ_BLOB, buf.length(), in); } } finally { buf.destroy(); } }
private TemporaryBuffer doMerge(MergeResult<RawText> result) throws IOException { TemporaryBuffer.LocalFile buf = new TemporaryBuffer.LocalFile( db != null ? nonNullRepo().getDirectory() : null, inCoreLimit); try { new MergeFormatter().formatMerge(buf, result, Arrays.asList(commitNames), UTF_8); buf.close(); } catch (IOException e) { buf.destroy(); throw e; } return buf; }
public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); entity = new TemporaryBufferEntity(new TemporaryBuffer.LocalFile(null)); entity.setContentLength(contentLength); }
public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new TemporaryBuffer.LocalFile(null)); return entity.getBuffer(); }
public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile()); return entity.getBuffer(); }
public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); entity = new TemporaryBufferEntity(new LocalFile()); entity.setContentLength(contentLength); }
public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setContentLength(contentLength); }
public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile()); entity.setChunked(true); }
/** {@inheritDoc} */ @Override public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); return entity.getBuffer(); }
public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setChunked(true); }
/** {@inheritDoc} */ @Override public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setChunked(true); }
public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); return entity.getBuffer(); }
/** {@inheritDoc} */ @Override public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setContentLength(contentLength); }
public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new TemporaryBuffer.LocalFile(null)); entity.setChunked(true); }
/** * Execute a command defined by a {@link java.lang.ProcessBuilder}. * * @param pb * The command to be executed * @param in * The standard input stream passed to the process * @return The result of the executed command * @throws java.lang.InterruptedException * @throws java.io.IOException * @since 4.2 */ public ExecutionResult execute(ProcessBuilder pb, InputStream in) throws IOException, InterruptedException { try (TemporaryBuffer stdout = new TemporaryBuffer.LocalFile(null); TemporaryBuffer stderr = new TemporaryBuffer.Heap(1024, 1024 * 1024)) { int rc = runProcess(pb, stdout, stderr, in); return new ExecutionResult(stdout, stderr, rc); } }