Home » Author Archives: Prasad Saya (page 3)

Author Archives: Prasad Saya

Prasad Saya
Prasad Saya is a software engineer with over ten years’ experience in application development, maintenance, testing and consulting on various platforms. He is a certified Java and Java EE developer. At present his interest is in developing Java applications. He also has experience working with databases and ERP applications.

org.apache.commons.io.comparator.LastModifiedFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. LastModifiedFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by their last modified date/time. The File class’s lastModified() method is used for comparing two files; the method ...

Read More »

java.nio.channels.FileLock Example

This article introduces the FileLock class and its basic usage. This article examples show using file locks with FileChannels. The examples in this article are compiled and run in Windows OS environment. Note that Java SE 7 is required to run the code. 1. Introduction FileLock is a token representing a lock on a region of a file. This is ...

Read More »

org.apache.commons.io.comparator.NameFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. NameFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by their name. The File class’s getName() method is used for comparing two files; the method returns the ...

Read More »

org.apache.commons.io.comparator.PathFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. PathFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by their path. The path value is a String returned from the File class’s getPath() method. The sort ...

Read More »

org.apache.commons.io.comparator.CompositeFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. CompositeFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by combining a number of other comparators defined within the same package (DirectoryFileComparator, ExtensionFileComparator, LastModifiedFileComparator, NameFileComparator, PathFileComparator, SizeFileComparator). ...

Read More »

org.apache.commons.io.comparator.DefaultFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. DefaultFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by using the default file comparison. This article shows usage of this class. The class is from Apache ...

Read More »

org.apache.commons.io.FilenameUtils Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io package has utility classes to perform common tasks. FilenameUtils is one of the classes. This class has static methods for filename and filepath manipulation. This class aims to help avoid those problems related with moving file names used in unix and Windows environments. This article ...

Read More »

java.nio.channels.AsynchronousChannelGroup Example

This article introduces the AsynchronousChannelGroup and its basic usage. This class is available since Java SE 7 as part of Java NIO 2 file API. This article’s example shows using this class with asynchronous channels. The example in this article is compiled and run in Windows OS environment. Note that Java SE 7 is required to run the code. 1. ...

Read More »

java.nio.channels.AsynchronousSocketChannel Example

This article introduces the AsynchronousSocketChannel and its basic usage. This class is available since Java SE 7 as part of Java NIO 2 file API. This article’s example shows the socket channel client sending messages to an AsynchronousServerSocketChannel server – in a client/server setup. The example in this article is compiled and run in Windows OS environment. Note that Java ...

Read More »

java.nio.channels.CompletionHandler Example

This article introduces the CompletionHandler and its basic usage. This interface is available since Java SE 7 as part of Java NIO 2 File API. This article’s example shows reading from a file using asynchronous file channel and using the completion handler to consume its result. The example in this article is compiled and run in Windows OS environment. Note ...

Read More »