Example usage for java.nio.channels FileChannel toString

List of usage examples for java.nio.channels FileChannel toString

Introduction

In this page you can find the example usage for java.nio.channels FileChannel toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:graphene.util.fs.FileUtils.java

public static void truncateFile(final FileChannel fileChannel, final long position) throws IOException {
        int count = 0;
        boolean success = false;
        do {//  www . j a va  2 s. com
            count++;
            try {
                fileChannel.truncate(position);
                success = true;
            } catch (final IOException e) {
            }

        } while (!success && (count <= WINDOWS_RETRY_COUNT));
        if (!success) {
            throw new IOException("Failure to truncateFile " + fileChannel.toString());
        }
    }