Details
-
Improvement
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
None
-
None
Description
The current approach for working with I/O is a bit convoluted. To make sure we integrate properly with multiple potential environments - Eclipse, IntelliJ, Netbeans, CLI - our APIs work mainly with Strings and InputStreams ( or byte-arrays ).
Although it works fine, it's starting to become awkward, as a single operation can consist of multiple calls to API methods due to this back-and-forth. For instance:
// Sling IDE API String serializationFilePath = serializationManager.getSerializationFilePath(resourceLocation, serializationKind); // Eclipse API IPath serializationFilePath2 = Path.fromPortableString(serializationFilePath); // Eclipse API IResource serializationResource = syncDirectory.findMember(serializationFilePath2); // a bit later... // Sling IDE API serializationManager.readSerializationData(serializationFilePath, serializationResource.getContents();
We should overhaul the I/O-based APIs to work with I/O abstractios ( e.g. FileReader -> EclipseFileReader ) and make those operations more coherent.