List of usage examples for org.apache.hadoop.fs FileSystem truncate
public boolean truncate(Path f, long newLength) throws IOException
From source file:com.mellanox.r4h.DistributedFileSystem.java
License:Apache License
@Override public boolean truncate(Path f, final long newLength) throws IOException { statistics.incrementWriteOps(1);/*ww w . jav a 2 s . c om*/ Path absF = fixRelativePart(f); return new FileSystemLinkResolver<Boolean>() { @Override public Boolean doCall(final Path p) throws IOException, UnresolvedLinkException { return dfs.truncate(getPathName(p), newLength); } @Override public Boolean next(final FileSystem fs, final Path p) throws IOException { return fs.truncate(p, newLength); } }.resolve(this, absF); }