Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-3733

Remodel API for more natural usage of IO operations

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Sling Eclipse IDE 1.2.4
    • Component/s: IDE
    • Labels:
      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rombert Robert Munteanu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: