src/main/java/com/instructure/canvasapi/model/FileFolder.java
// we override compareTo instead of using Canvas Comparable methods
we override compareTo instead of using Canvas Comparable methods
we override compareTo instead of using Canvas Comparable methods
@Override
    public int compareTo(FileFolder other) {
        if (getFullName() != null && other.getFullName() == null) {
            return -1;
        } 
        else if (getFullName() == null && other.getFullName() != null) {
            return 1;
        }
        if (getFullName() != null && other.getFullName() != null) {
            return getFullName().compareTo(other.getFullName());
        }
        return getDisplayName().compareTo(other.getDisplayName());
    }
@ Override public int compareTo ( FileFolder other ) { if ( getFullName ( ) != null && other . getFullName ( ) == null ) { return - 1 ; } else if ( getFullName ( ) == null && other . getFullName ( ) != null ) { return 1 ; } if ( getFullName ( ) != null && other . getFullName ( ) != null ) { return getFullName ( ) . compareTo ( other . getFullName ( ) ) ; } return getDisplayName ( ) . compareTo ( other . getDisplayName ( ) ) ; }
we override compareTo instead of using Canvas Comparable methods
we override compareTo instead of using Canvas Comparable methods
// folders go before files // this is a folder and other is a file // this is a file and other is a folder // both are folders // both are files