-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
Storing the data is a two step process.
Create a Data instance
You must find the correct sensor in the database first.
Sensor sensor = em.find(Sensor.class, "the-sensor-id");
Data data = new Data(from, to, sensor);
em.persist(data);Helpfull classes:
Copy files
After the sensor is persisted, you have to copy the files to the harddrive.
ISensor sensorInstance = ... // from sensorManager, not db instance!
Data data = new Data(from, to, sensor);
try (InputStream in = sensorInstance.getDataInputStream()) {
// data.toPath() gets the harddrive path
Files.copy(in, data.toPath());
}Metadata
Metadata
Assignees
Labels
No labels