return a folder name that match given input

@param name
@param cfid
@param addExtension
@return
978705
public static String getFolderName(String name, String cfid, boolean addExtension) {
	if (addExtension) return getFolderName(name, cfid, false) + ".scpt";
	if (!StringUtil.isEmpty(name)) name = encode(name);// StringUtil.toVariableName(StringUtil.toLowerCase(name));
	else name = "__empty__";
	return name + "/" + cfid.substring(0, 2) + "/" + cfid.substring(2);
    }
1248857
public void addExtension(String name) throws Exception {
        // /extension=<name>/:add(module=<name>)
        final ModelNode request = createRequest(ADD, Address.root().add(EXTENSION, name));
        request.get(MODULE).set(name);
        final ModelNode response = execute(request);
        if (!isSuccess(response)) {
            throw new FailureException(response, "Failed to add new module extension [" + name + "]");
        }
        return;
    }
857857
public static File addExtension(final File f, final String extension) {
    checkNotNull(f);
    checkNotNull(extension);
    Preconditions.checkArgument(!extension.isEmpty());
    Preconditions.checkArgument(!f.isDirectory());

    final String absolutePath = f.getAbsolutePath();
    return new File(absolutePath + "." + extension);
  }
1065060
private function isFilenameEndingWithExtension($name)
	{
		return \strrpos($name, self::EXTENSION) === (\strlen($name) - self::EXTENSION_LENGTH);
	}
277791
private static final String getFilenameFromId(String pid, String dsid, String MIMETYPE) throws Exception {
        return dsid;
    }
1045482
public ExtensionAuthor getExtensionAuthor(String name, String url)
    {
        return getExtensionAuthor(new DefaultExtensionAuthor(name, url));
    }
437188
def add_suffix(fullname, suffix):
    
    name, ext = os.path.splitext(fullname)
    return name + '_' + suffix + ext
394532
public static String getExtension(String fileName) {
    int pos = fileName.lastIndexOf('.');
    if (pos < 0) {
      return "";
    }
    return fileName.substring(pos + 1);
  }
1320104
public static String getFilenameExtension(String path) {
        if (path == null) return null;

        int extIndex = path.lastIndexOf(EXTENSION_SEPARATOR);
        if (extIndex == -1) return null;

        int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR);
        if (folderIndex > extIndex) return null;

        return path.substring(extIndex + 1);
    }
666492
private String getUniqueScriptName(String name, String ext) {
		if (this.getScriptImpl(name) == null) {
			// Its unique
			return name;
		}
		// Its not unique, add a suitable index...
		String stub = name.substring(0, name.length() - ext.length() - 1);
		int index = 1;
		do {
			index++;
			name = stub + "(" + index + ")." + ext;
		}
		while (this.getScriptImpl(name) != null);
		
		return name;
	}
938412
public void addExtension(File extensionToInstall) throws IOException {
    verifyPathIsOEX(extensionToInstall);
    createInitialDirectoryIfNecessary();

    String wuid = WUID_PREFIX + UUID.randomUUID().toString();
    // the name is guaranteed to end with .oex, enforced earlier by the verifyPathIsOEX method.
    File oexfile = File.createTempFile(OEX_PATH_PREFIX, extensionToInstall.getName(), directory);

    Files.copy(extensionToInstall, oexfile);
    writeOEXtoWidgetsDat(wuid, oexfile);
    createOEXDirectory(wuid);
  }
852839
public static String getSafeExtension(final String filename) {
        // extension does not include period (.)
        final String extension = FilenameUtils.getExtension(filename);
        return isSafeExtension(extension) ? "." + extension : StringUtils.EMPTY;
    }
1033309
private String getExtension(String fileName) {
		if (fileName == null) {
            return null;
        }

		String ext = null;
		int i = fileName.lastIndexOf('.');

		if (i > 0 && i < fileName.length() - 1) {
			ext = fileName.substring(i + 1).toLowerCase();
		}
		return ext;
	}
876940
public CMFolder addChild( String id, String name )
    {
        CMFolder childFolder = new CMFolder( id, name );
        childFolder.parent = this;
        this.children.put( name, childFolder );
        return childFolder;
    }
338056
public static String getExtension(String resourceName) {

        String result = null;
        if (!resourceName.endsWith("/")) {
            // folders don't have any extension
            resourceName = CmsResource.getName(resourceName);
            int index = resourceName.lastIndexOf(".") + 1;
            if ((index > 0) && (index < resourceName.length())) {
                result = resourceName.substring(index).toLowerCase();
            }
        }

        return result;
    }
978509
public static IdentifierExtension findFirst(Collection<? extends Extension> extensions)
    {
        for (Extension extension : extensions)
        {
            if (IDENTIFIER_EXTENSION_ID == extension.getId()) return (IdentifierExtension)extension;
        }
        return null;
    }
173235
public static String getExtension(String fileName) {
        if (fileName == null)
            return null;
        if (fileName.isEmpty())
            return "";

        int idx = fileName.lastIndexOf(".");
        if (idx != -1) {
            return fileName.substring(idx);
        } else {
            return "";
        }
    }