List objects in a Amazon S3 folder without also listing objects in sub folders
In the ListObjectsRequest javadoc there is a method called withDelimiter(String delimiter).  Adding .withDelimiter("/") after the .withPrefix(prefix) call then you will receive only a list of objects at the same folder level as the prefix (avoiding the need to filter the returned ObjectListing after the list was sent over the wire).

Some notes about the code:

1, I'd extract out to a local variable for the ListObjectsRequest instance:

final ListObjectsRequest listObjectRequest = new ListObjectsRequest().
    withBucketName(AWSConfiguration.BUCKET).
    withPrefix(prefix);
final ObjectListing objectListing = s3.listObjects(listObjectRequest);


It's easier to read.

2, root_size should be rootSize. (Regarding to the Java Coding Conventions.)

3, I would use String.contains instead of indexOf. It's more meaningful, easier to read since you don't have to use the -1 magic number.

4, In the last snippet I'd create a local variable for the key:

for (final S3ObjectSummary objectSummary: objectListing.getObjectSummaries()) {
    final String key = objectSummary.getKey();
    if (S3Asset.isImmediateDescendant(prefix, key)) {
        final String relativePath = getRelativePath(prefix, key);
        System.out.println(relativePath);
    }
}


5, Furthermore, I'd move the length call inside the helper method:

public String getRelativePath(final String parent, final String child) {
    if (!child.startsWith(parent)) {
        throw new IllegalArgumentException("Invalid child '" + child 
            + "' for parent '" + parent + "'");
    }
    // a String.replace() also would be fine here
    final int parentLen = parent.length();
    return child.substring(parentLen);
}

public boolean isImmediateDescendant(final String parent, final String child) {
    if (!child.startsWith(parent)) {
        // maybe we just should return false
        throw new IllegalArgumentException("Invalid child '" + child 
            + "' for parent '" + parent + "'");
    }
    final int parentLen = parent.length();
    final String childWithoutParent = child.substring(parentLen);
    if (childWithoutParent.contains("/")) {
        return false;
    }
    return true;
}


Note the input check. (Effective Java, Second Edition, Item 38: Check parameters for validity)

The multiple calls of length could look redundant and slow but premature optimization is not a good thing (see Effective Java, Second Edition, Item 55: Optimize judiciously). If you check the source of java.lang.String, you will find this:

/** The count is the number of characters in the String. */
private final int count;

...

public int length() {
    return count;
}


String is immutable, so it's easy to cache its length and JDK does it for you.