@Test public void testPrepare0() throws Exception { final ResumeFilter f = new ResumeFilter(new DisabledUploadSymlinkResolver(), new NullSession(new Host(new TestProtocol())), new UploadFilterOptions().withTemporary(true)); final Path t = new Path("t", EnumSet.of(Path.Type.file)); t.attributes().setSize(0L); final TransferStatus status = f.prepare(t, new NullLocal("t"), new TransferStatus().exists(true), new DisabledProgressListener()); assertFalse(status.isAppend()); assertNotNull(status.getRename().remote); assertEquals(0L, status.getOffset()); }
@Override public TransferStatus prepare(final Path file, final Local local, final TransferStatus parent, final ProgressListener progress) throws BackgroundException { final TransferStatus status = super.prepare(file, local, parent, progress); if(file.isFile()) { if(parent.isExists()) { final Write.Append append = upload.append(file, status.getLength(), cache); if(append.append && append.size < local.attributes().getSize()) { status.setAppend(true); status.setLength(status.getLength() - append.size); status.setOffset(append.size); status.rename((Path) null); } } } return status; }
ResumeFilter extends AbstractUploadFilter { @Override public TransferStatus prepare(final Path file, final Local local, final TransferStatus parent, final ProgressListener progress) throws BackgroundException { final TransferStatus status = super.prepare(file, local, parent, progress); if(file.isFile()) { if(parent.isExists()) { final Write.Append append = upload.append(file, status.getLength(), cache); if(append.append && append.size < local.attributes().getSize()) { status.setAppend(true); status.setLength(status.getLength() - append.size); status.setOffset(append.size); status.rename((Path) null); } } } return status; } }
ResumeFilter extends AbstractUploadFilter { @Override public TransferStatus prepare(final Path file, final Local local, final TransferStatus parent, final ProgressListener progress) throws BackgroundException { final TransferStatus status = super.prepare(file, local, parent, progress); if(file.isFile()) { if(parent.isExists()) { final Write.Append append = upload.append(file, status.getLength(), cache); if(append.append && append.size < local.attributes().getSize()) { status.setAppend(true); status.setLength(status.getLength() - append.size); status.setOffset(append.size); status.rename((Path) null); } } } return status; } ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session);  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                        final UploadFilterOptions options);  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                        final UploadFilterOptions options, final Upload upload); }
ResumeFilter extends AbstractUploadFilter { @Override public TransferStatus prepare(final Path file, final Local local, final TransferStatus parent, final ProgressListener progress) throws BackgroundException { final TransferStatus status = super.prepare(file, local, parent, progress); if(file.isFile()) { if(parent.isExists()) { final Write.Append append = upload.append(file, status.getLength(), cache); if(append.append && append.size < local.attributes().getSize()) { status.setAppend(true); status.setLength(status.getLength() - append.size); status.setOffset(append.size); status.rename((Path) null); } } } return status; } ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session);  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                        final UploadFilterOptions options);  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                        final UploadFilterOptions options, final Upload upload); @Override AbstractUploadFilter withCache(final Cache<Path> cache); @Override boolean accept(final Path file, final Local local, final TransferStatus parent); @Override TransferStatus prepare(final Path file, final Local local, final TransferStatus parent, final ProgressListener progress); }
ResumeFilter extends AbstractUploadFilter { @Override public TransferStatus prepare(final Path file, final Local local, final TransferStatus parent, final ProgressListener progress) throws BackgroundException { final TransferStatus status = super.prepare(file, local, parent, progress); if(file.isFile()) { if(parent.isExists()) { final Write.Append append = upload.append(file, status.getLength(), cache); if(append.append && append.size < local.attributes().getSize()) { status.setAppend(true); status.setLength(status.getLength() - append.size); status.setOffset(append.size); status.rename((Path) null); } } } return status; } ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session);  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                        final UploadFilterOptions options);  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                        final UploadFilterOptions options, final Upload upload); @Override AbstractUploadFilter withCache(final Cache<Path> cache); @Override boolean accept(final Path file, final Local local, final TransferStatus parent); @Override TransferStatus prepare(final Path file, final Local local, final TransferStatus parent, final ProgressListener progress);  }