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

Remodel API for more natural usage of IO operations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • Sling Eclipse IDE 2.0.0
    • IDE
    • 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

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

            Dates

              Created:
              Updated: