code: protected String getObjectPath(String id, String name) {
          // The format of the object id is <type>/<path>/<objectName>
          id = id.substring(id.indexOf('/') + 1);
          if (id.charAt(0) == '/') {
              id = id.substring(1);
          }
          if (id.lastIndexOf(name) <= 0) {
              return id;
          }
          return id.substring(0, id.lastIndexOf(name) - 1);
      }
docs: Get object path for given id and name. The format of the object id is
  
  <pre>
  type / path / objectName
  </pre>
  
  @param id
  object id
  @param name
  object name
  @return resource path