Java String Shorten shortenRemoteRef(final String origin, final String ref)

Here you can find the source of shortenRemoteRef(final String origin, final String ref)

Description

Cut the origin part off a remote ref.

License

Open Source License

Declaration

public static String shortenRemoteRef(final String origin, final String ref) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/* w  w  w  . ja va 2s  .  c o  m*/
     * Cut the origin part off a remote ref.
     */
    public static String shortenRemoteRef(final String origin, final String ref) {
        if (!ref.startsWith(origin + "/")) {
            return ref;
        }

        return ref.substring(origin.length() + 1);
    }
}

Related

  1. shortenOperationName(String operation)
  2. shortenPackageName(String name, boolean remove)
  3. shortenPart(String currentPart)
  4. shortenPath(final String path)
  5. shortenPrefix(String prefix)
  6. shortenString(String orig, int charsToRemove)
  7. shortenString(String orig, int maxLength)
  8. shortenString(String s, int maxLength)
  9. shortenString(String s, int requiredLength)