Create a class named MyIOManager that implements the accompanying interface IOManager. MyIOManager should adequately implement all methods in the IOManager such that it accepts and returns the defined parameters and throws the outlined exceptions correctly. When you submit your assignment to Grader Than only submit your MyIOManager.java file. package homework; import java.io.FileNotFoundException; import java.io.IOException; public interface IOManager { /** * Sets the file path that this IOManager will read and write an object from. This * file location will be used by {@link #read()} and {@link #write(Object)} * @param path The file location to be read and written to * @throws FileNotFoundException when the specified path can not be found. * @throws IllegalArgumentException When the specified path points to a folder/directory rather than a file */ public void setPath(String path) throws FileNotFoundException, IllegalArgumentException; /** * The file path that is IOManager read and write an object from. This * file location will is used by {@link #read()} and {@link #write(Object)}. * This method may not return a null value. If the path is not set this should * return an empty string. * @param path The file location to be read and written to */ public void getPath(); /** * Reads the object saved in the file located at the path returned by {@link #getPath()} * @return An object saved in the file * @throws IOException When something goes wrong in the IO process * @throws ClassNotFoundException If the object located at the is a class that is not implemented * by this version of your software * @throws IllegalStateException If the file path has not been set yet */ public T read() throws IOException, ClassNotFoundException, IllegalStateException; /** * Writes and object to saved at the file located at the path returned by {@link #getPath()} * @param object The object saved in the file * @throws IOException When something goes wrong in the IO process * @throws IllegalStateException If the file path has not been set yet */ public void write(T object) throws IOException, IllegalStateException;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Create a class named MyIOManager that implements the accompanying interface IOManager. MyIOManager should adequately implement all methods in the IOManager such that it accepts and returns the defined parameters and throws the outlined exceptions correctly. When you submit your assignment to Grader Than only submit your MyIOManager.java file. 

 

package homework;

import java.io.FileNotFoundException;
import java.io.IOException;

public interface IOManager<T extends Object> {

/**
* Sets the file path that this IOManager will read and write an object from. This
* file location will be used by {@link #read()} and {@link #write(Object)}
* @param path The file location to be read and written to
* @throws FileNotFoundException when the specified path can not be found.
* @throws IllegalArgumentException When the specified path points to a folder/directory rather than a file
*/
public void setPath(String path) throws FileNotFoundException, IllegalArgumentException;

/**
* The file path that is IOManager read and write an object from. This
* file location will is used by {@link #read()} and {@link #write(Object)}.
* This method may not return a null value. If the path is not set this should
* return an empty string.
* @param path The file location to be read and written to
*/
public void getPath();

/**
* Reads the object saved in the file located at the path returned by {@link #getPath()}
* @return An object saved in the file
* @throws IOException When something goes wrong in the IO process
* @throws ClassNotFoundException If the object located at the is a class that is not implemented
* by this version of your software
* @throws IllegalStateException If the file path has not been set yet
*/
public T read() throws IOException, ClassNotFoundException, IllegalStateException;

/**
* Writes and object to saved at the file located at the path returned by {@link #getPath()}
* @param object The object saved in the file
* @throws IOException When something goes wrong in the IO process
* @throws IllegalStateException If the file path has not been set yet
*/
public void write(T object) throws IOException, IllegalStateException;

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education