{
    "componentChunkName": "component---src-templates-list-series-js",
    "path": "/series/java-i-o/",
    "result": {"data":{"site":{"siteMetadata":{"name":"CalliCoder","title":"Programming, Web development, System design & Devops Tutorials","description":"CalliCoder is a one stop destination for software developers looking for practical guides and tutorials on Programming languages, Web Development, System Design, DevOps, Java, Kotlin, Golang, Spring Boot and Node.js.","author":"Rajeev Singh"}},"allMdx":{"totalCount":11,"edges":[{"node":{"excerpt":"In this short article, you'll learn how to delete a directory recursively along with all its subdirectories and files.  There are two…","timeToRead":1,"fields":{"slug":"/java-delete-directory-recursively-with-subdirectories-files/"},"frontmatter":{"date":"August 19, 2020","title":"How to delete a directory recursively with all its subdirectories and files in Java","type":"post","description":"You can delete a directory recursively by walking the file-tree and deleting all the files in a directory before deleting the directory itself. You can use the Files.walk(Path) method or Files.walkFileTree(Path, FileVisitor) method to traverse the file tree, and then delete files/directories.","categories":["java"],"image":{"publicURL":"/static/bf5cb03fb3af21a8eb14d94753d35832/java-delete-directory-recursively.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/bf5cb03fb3af21a8eb14d94753d35832/5dfc8/java-delete-directory-recursively.jpg","srcSet":"/static/bf5cb03fb3af21a8eb14d94753d35832/5f9d5/java-delete-directory-recursively.jpg 163w,\n/static/bf5cb03fb3af21a8eb14d94753d35832/123ee/java-delete-directory-recursively.jpg 325w,\n/static/bf5cb03fb3af21a8eb14d94753d35832/5dfc8/java-delete-directory-recursively.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/bf5cb03fb3af21a8eb14d94753d35832/79f7a/java-delete-directory-recursively.webp 163w,\n/static/bf5cb03fb3af21a8eb14d94753d35832/e4f3d/java-delete-directory-recursively.webp 325w,\n/static/bf5cb03fb3af21a8eb14d94753d35832/612f6/java-delete-directory-recursively.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"There are various ways in which you can create a new file in Java. In this article, I've outlined the two most recommended way of creating…","timeToRead":1,"fields":{"slug":"/how-to-create-new-file-java/"},"frontmatter":{"date":"August 01, 2020","title":"How to create a new file in Java","type":"post","description":"Java create new file examples. You can create a new File using Files.createFile() method of Java NIO or file.createNewFile() method of java.io.File class. You can also create missing parent directories while creating files using any of these methods.","categories":["java"],"image":{"publicURL":"/static/00eb4c4b1ba8b16aff6f2f7405c8e831/java-create-new-file.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/00eb4c4b1ba8b16aff6f2f7405c8e831/5dfc8/java-create-new-file.jpg","srcSet":"/static/00eb4c4b1ba8b16aff6f2f7405c8e831/5f9d5/java-create-new-file.jpg 163w,\n/static/00eb4c4b1ba8b16aff6f2f7405c8e831/123ee/java-create-new-file.jpg 325w,\n/static/00eb4c4b1ba8b16aff6f2f7405c8e831/5dfc8/java-create-new-file.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/00eb4c4b1ba8b16aff6f2f7405c8e831/79f7a/java-create-new-file.webp 163w,\n/static/00eb4c4b1ba8b16aff6f2f7405c8e831/e4f3d/java-create-new-file.webp 325w,\n/static/00eb4c4b1ba8b16aff6f2f7405c8e831/612f6/java-create-new-file.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"In this article, you'll learn how to read a text file or binary (image) file in Java using various classes and utility methods provided by…","timeToRead":1,"fields":{"slug":"/java-read-file/"},"frontmatter":{"date":"May 16, 2020","title":"How to read a File in Java","type":"post","description":"In this article, you'll learn how to read a text or binary (image) file in Java using various classes and utility methods provided by Java like BufferedReader, LineNumberReader, Files.readAllLines, Files.lines, BufferedInputStream, Files.readAllBytes, etc.","categories":["java"],"image":{"publicURL":"/static/c2279fcd9c374aff88491b36b955723b/java-read-file.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/c2279fcd9c374aff88491b36b955723b/5dfc8/java-read-file.jpg","srcSet":"/static/c2279fcd9c374aff88491b36b955723b/5f9d5/java-read-file.jpg 163w,\n/static/c2279fcd9c374aff88491b36b955723b/123ee/java-read-file.jpg 325w,\n/static/c2279fcd9c374aff88491b36b955723b/5dfc8/java-read-file.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/c2279fcd9c374aff88491b36b955723b/79f7a/java-read-file.webp 163w,\n/static/c2279fcd9c374aff88491b36b955723b/e4f3d/java-read-file.webp 325w,\n/static/c2279fcd9c374aff88491b36b955723b/612f6/java-read-file.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"In this article, you'll learn how to copy a non-empty directory recursively with all its sub-directories and files to another location in…","timeToRead":1,"fields":{"slug":"/java-copy-directory-recursively/"},"frontmatter":{"date":"March 15, 2020","title":"How to copy Directories recursively in Java","type":"post","description":"In this article, you'll learn how to copy a non-empty directory recursively with all its sub-directories and files to another location in Java.","categories":["java"],"image":{"publicURL":"/static/40098d76ff7d1a09fa31c893524bde46/java-copy-directory-recursively.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/40098d76ff7d1a09fa31c893524bde46/5dfc8/java-copy-directory-recursively.jpg","srcSet":"/static/40098d76ff7d1a09fa31c893524bde46/5f9d5/java-copy-directory-recursively.jpg 163w,\n/static/40098d76ff7d1a09fa31c893524bde46/123ee/java-copy-directory-recursively.jpg 325w,\n/static/40098d76ff7d1a09fa31c893524bde46/5dfc8/java-copy-directory-recursively.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/40098d76ff7d1a09fa31c893524bde46/79f7a/java-copy-directory-recursively.webp 163w,\n/static/40098d76ff7d1a09fa31c893524bde46/e4f3d/java-copy-directory-recursively.webp 325w,\n/static/40098d76ff7d1a09fa31c893524bde46/612f6/java-copy-directory-recursively.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"In this article, you'll learn how to copy a file or directory in Java using various methods like  Files.copy()  or using…","timeToRead":1,"fields":{"slug":"/java-copy-file/"},"frontmatter":{"date":"March 01, 2020","title":"How to copy a File or Directory in Java","type":"post","description":"In this article, you'll learn how to copy a file or directory in Java using various methods like Files.copy() or using BufferedInputStream and BufferedOutputStream","categories":["java"],"image":{"publicURL":"/static/d42aa067761bc53148235ab4363d6398/java-copy-file.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/d42aa067761bc53148235ab4363d6398/5dfc8/java-copy-file.jpg","srcSet":"/static/d42aa067761bc53148235ab4363d6398/5f9d5/java-copy-file.jpg 163w,\n/static/d42aa067761bc53148235ab4363d6398/123ee/java-copy-file.jpg 325w,\n/static/d42aa067761bc53148235ab4363d6398/5dfc8/java-copy-file.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/d42aa067761bc53148235ab4363d6398/79f7a/java-copy-file.webp 163w,\n/static/d42aa067761bc53148235ab4363d6398/e4f3d/java-copy-file.webp 325w,\n/static/d42aa067761bc53148235ab4363d6398/612f6/java-copy-file.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"In this quick and short article, you'll find two examples demonstrating how to check if a File or Directory exists at a given path in Java…","timeToRead":1,"fields":{"slug":"/java-check-file-directory-exists/"},"frontmatter":{"date":"February 28, 2020","title":"How to check if a File or Directory exists in Java","type":"post","description":"In this article, you'll learn how to check if a File or Directory exists in the file system in Java. You can use Java IO's File.exists() or Java NIO's Files.exists() or Files.notExists() methods to check the existence of a File or Directory in the filesystem.","categories":["java"],"image":{"publicURL":"/static/53b4e1fa6ea1543c77b2a88c7c939fad/java-check-file-directory-exists.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/53b4e1fa6ea1543c77b2a88c7c939fad/5dfc8/java-check-file-directory-exists.jpg","srcSet":"/static/53b4e1fa6ea1543c77b2a88c7c939fad/5f9d5/java-check-file-directory-exists.jpg 163w,\n/static/53b4e1fa6ea1543c77b2a88c7c939fad/123ee/java-check-file-directory-exists.jpg 325w,\n/static/53b4e1fa6ea1543c77b2a88c7c939fad/5dfc8/java-check-file-directory-exists.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/53b4e1fa6ea1543c77b2a88c7c939fad/79f7a/java-check-file-directory-exists.webp 163w,\n/static/53b4e1fa6ea1543c77b2a88c7c939fad/e4f3d/java-check-file-directory-exists.webp 325w,\n/static/53b4e1fa6ea1543c77b2a88c7c939fad/612f6/java-check-file-directory-exists.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"In this simple and quick article, you'll learn how to delete a file or directory in Java. The article demonstrates two ways of deleting a…","timeToRead":1,"fields":{"slug":"/java-delete-file/"},"frontmatter":{"date":"February 28, 2020","title":"How to delete a file or directory in Java","type":"post","description":"Learn how to delete a file or directory in Java. You can delete a file using Files.delete(Path) method of Java NIO or the delete() method of java.io.File class.","categories":["java"],"image":{"publicURL":"/static/903836a722bc9380fd84b4506180c9cf/java-delete-file.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/903836a722bc9380fd84b4506180c9cf/5dfc8/java-delete-file.jpg","srcSet":"/static/903836a722bc9380fd84b4506180c9cf/5f9d5/java-delete-file.jpg 163w,\n/static/903836a722bc9380fd84b4506180c9cf/123ee/java-delete-file.jpg 325w,\n/static/903836a722bc9380fd84b4506180c9cf/5dfc8/java-delete-file.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/903836a722bc9380fd84b4506180c9cf/79f7a/java-delete-file.webp 163w,\n/static/903836a722bc9380fd84b4506180c9cf/e4f3d/java-delete-file.webp 325w,\n/static/903836a722bc9380fd84b4506180c9cf/612f6/java-delete-file.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"In this quick and short article, you'll learn how to move or rename a file or directory in Java. Java Move or Rename File using Files.move…","timeToRead":1,"fields":{"slug":"/java-move-file/"},"frontmatter":{"date":"February 15, 2020","title":"How to move or rename a File or Directory in Java","type":"post","description":"In this article, you'll learn how to move or rename a file or directory in Java. You can move or rename a file using the Files.move() method in the java.nio.file.Files class.","categories":["java"],"image":{"publicURL":"/static/db15e26c4fc1d796a6d0ecdcbd2aecbc/java-move-rename-file-directory.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/db15e26c4fc1d796a6d0ecdcbd2aecbc/5dfc8/java-move-rename-file-directory.jpg","srcSet":"/static/db15e26c4fc1d796a6d0ecdcbd2aecbc/5f9d5/java-move-rename-file-directory.jpg 163w,\n/static/db15e26c4fc1d796a6d0ecdcbd2aecbc/123ee/java-move-rename-file-directory.jpg 325w,\n/static/db15e26c4fc1d796a6d0ecdcbd2aecbc/5dfc8/java-move-rename-file-directory.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/db15e26c4fc1d796a6d0ecdcbd2aecbc/79f7a/java-move-rename-file-directory.webp 163w,\n/static/db15e26c4fc1d796a6d0ecdcbd2aecbc/e4f3d/java-move-rename-file-directory.webp 325w,\n/static/db15e26c4fc1d796a6d0ecdcbd2aecbc/612f6/java-move-rename-file-directory.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"In this article, you'll learn how to write data to a file in Java.  Java has several ways of writing data to a File using various built-in…","timeToRead":2,"fields":{"slug":"/java-write-to-file/"},"frontmatter":{"date":"February 15, 2020","title":"How to write to a File in Java","type":"post","description":"In this article, you'll learn how to write data to a file in Java. Java has several ways of writing data to a File using various built-in classes like BufferedWriter, FileWriter, PrintWriter, FileOutputStream, BufferedOutputStream, DataOutputStream, RandomAccessFile, FileChannel, etc. We'll look at each of them with the help of examples.","categories":["java"],"image":{"publicURL":"/static/273998b0afb84ede6ba479378899dae2/java-write-to-file.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/273998b0afb84ede6ba479378899dae2/5dfc8/java-write-to-file.jpg","srcSet":"/static/273998b0afb84ede6ba479378899dae2/5f9d5/java-write-to-file.jpg 163w,\n/static/273998b0afb84ede6ba479378899dae2/123ee/java-write-to-file.jpg 325w,\n/static/273998b0afb84ede6ba479378899dae2/5dfc8/java-write-to-file.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/273998b0afb84ede6ba479378899dae2/79f7a/java-write-to-file.webp 163w,\n/static/273998b0afb84ede6ba479378899dae2/e4f3d/java-write-to-file.webp 325w,\n/static/273998b0afb84ede6ba479378899dae2/612f6/java-write-to-file.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}},{"node":{"excerpt":"In this quick and simple article, you'll learn how to create a read only file or mark an existing file as read only. Java create Read only…","timeToRead":1,"fields":{"slug":"/java-create-read-only-file/"},"frontmatter":{"date":"February 01, 2020","title":"Java Create Read only file or Mark a file as Read only","type":"post","description":"In this quick and simple article, you'll learn how to create a read only file or mark an existing file as read only. One way is to use the FileAttribute class of Java's NIO package to set file permissions. Another way is to use java.io.File class's setReadOnly or setWritable methods.","categories":["java"],"image":{"publicURL":"/static/9ec7784ee5ae46ebee031912ea02c43a/java-create-read-only-file.jpg","childImageSharp":{"gatsbyImageData":{"layout":"constrained","backgroundColor":"#082838","images":{"fallback":{"src":"/static/9ec7784ee5ae46ebee031912ea02c43a/5dfc8/java-create-read-only-file.jpg","srcSet":"/static/9ec7784ee5ae46ebee031912ea02c43a/5f9d5/java-create-read-only-file.jpg 163w,\n/static/9ec7784ee5ae46ebee031912ea02c43a/123ee/java-create-read-only-file.jpg 325w,\n/static/9ec7784ee5ae46ebee031912ea02c43a/5dfc8/java-create-read-only-file.jpg 650w","sizes":"(min-width: 650px) 650px, 100vw"},"sources":[{"srcSet":"/static/9ec7784ee5ae46ebee031912ea02c43a/79f7a/java-create-read-only-file.webp 163w,\n/static/9ec7784ee5ae46ebee031912ea02c43a/e4f3d/java-create-read-only-file.webp 325w,\n/static/9ec7784ee5ae46ebee031912ea02c43a/612f6/java-create-read-only-file.webp 650w","type":"image/webp","sizes":"(min-width: 650px) 650px, 100vw"}]},"width":650,"height":347}}}}}}]}},"pageContext":{"basePath":"/series/java-i-o/","series":"java-i/o","seriesSlug":"java-i-o","limit":10,"skip":0,"numPages":2,"currentPage":1}},
    "staticQueryHashes": ["2935368691","3127135171"]}