Abstract
One of the most important functions in software is information organizing and storage, with the goal of using it and sharing it. Information is written on paper and stored in organized cabinets in real life where it can be retrieved from. Software applications do something similar. Information is written in files, files are organized in directories and eventually when in even more complex structures named databases. Java provides classes to read information from files and databases and classes to write files and write information to databases. In Chapter 9 , a simple example using a Derby in-memory database was introduced to show you how heavy dependencies like databases can be mocked to allow unit testing. This chapter is not about using databases, because writing Java applications for databases requires extra software to be installed. Instead, the chapter focuses on reading and writing files, and the many ways it can be done.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Project Amber official page http://openjdk.java.net/projects/amber/
- 2.
Official GitHub repository for the company that produces the Jackson library https://github.com/FasterXML
- 3.
The portable pixmap format (PPM), the portable graymap format (PGM) and the portable bitmap format (PBM) are image file formats designed to be easily exchanged between platforms. They are also sometimes referred to collectively as the portable any map format (PNM). More details at https://en.wikipedia.org/wiki/Netpbm_format
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Iuliana Cosmina
About this chapter
Cite this chapter
Cosmina, I. (2018). Working with Files. In: Java for Absolute Beginners. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3778-6_11
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3778-6_11
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3777-9
Online ISBN: 978-1-4842-3778-6
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)