In this tutorial we will learn how to create a new file in Java. java.io.File.createNewFile() Creates a new empty file named by this abstract pathname. If and only if a file with this name does not yet exist.
In this tutorial we will learn how to get free disk space in Java. File.getTotalSpace(), File.getFreeSpace() and File.getUsableSpace() methods are used to get total size of the partition, unallocated bytes in the partition and bytes available to this virtual machine on the partition respectively.
In this tutorial we will learn how to create temporary file in Java. There are two static methods createTempFile() in the Java File class, Which will help to create temp file on default TEMP folder location and another one is used to create temp file on specified folder location.
In this tutorial we will learn how to create directory in Java. Use File mkdir() and mkdirs() methods to create directory and multiple directories with path names. As both methods mkdir() and mkdirs() return a boolean value indicating whether the directories are successfully created or not.
In this tutorial we will learn how to create new collection with different options, Capped collection, collection with document validation option. Use db.createCollection(name, options) method to create new collection in the database.
In this tutorial we will learn how to create an auto increment sequence field using mongoDB. MongoDB creates a unique index on the _id field while creating collection. By default mongoDB uses standard auto generated ObjectId to maintain the sequence / uniqueness for _id field in the document.