Insert a fragment, replacing the old value if the path exists.

@param path the path where to insert (or replace) a dictionary value.
@param fragment the new dictionary value to be applied.
10494
public <T> AsyncMutateInBuilder upsert(String path, T fragment) {
        if (StringUtil.isNullOrEmpty(path)) {
            throw new IllegalArgumentException("Path must not be empty for upsert");
        }
        this.mutationSpecs.add(new MutationSpec(Mutation.DICT_UPSERT, path, fragment));
        return this;
    }
273115
public Resource addPath(String path)
        throws IOException,MalformedURLException
    {
        if (path==null)
            return null;

        path = URI.canonicalPath(path);

        return newResource(URI.addPaths(_url.toExternalForm(),path));
    }
573997
public EndpointInfoBuilder fragment(String fragment) {
        requireNonNull(fragment, "fragment");
        checkState(regexPathPrefix == null, "fragment cannot be set with regexPathPrefix: %s", regexPathPrefix);
        this.fragment = fragment;
        return this;
    }
349808
public void setPath(String path)
    {
        if (getState() != __MSG_EDITABLE) throw new IllegalStateException("Not EDITABLE");
        if (_uri == null)
            _uri = new URI(path);
        else
            _uri.setURI(path);
    }
30325
public void deletePath(String path) {
        if (path == null) {
            return;
        }
        String[] pathComponents = path.split("/");
        TrieNode parent = rootNode;
        String part = null;
        if (pathComponents.length <= 1) {
            throw new IllegalArgumentException("Invalid path " + path);
        }
        for (int i=1; i<pathComponents.length; i++) {
            part = pathComponents[i];
            if (parent.getChild(part) == null) {
                //the path does not exist
                return;
            }
            parent = parent.getChild(part);
            LOG.info(parent);
        }
        TrieNode realParent  = parent.getParent();
        realParent.deleteChild(part);
    }
400440
public static void write(InputStream in, Path path) {
        write(in, path, StandardCopyOption.REPLACE_EXISTING);
    }
242895
public void setPath(String path) {
        this.path = path;

        List<Token> tokens = Tokenizer.tokenize(path, true);
        int tokenCount = 0;
        for (Token t : tokens) {
            if (t.getType() != TokenType.TEXT) {
                tokenCount++;
            }
        }
        if (tokenCount > 0) {
            this.pathTokens = tokens.toArray(new Token[0]);
        } else {
            this.pathTokens = null;
        }
    }
1119925
public void add(String fragment, List<Object> params) {

        m_buffer.append(fragment);
        m_params.addAll(params);
    }
873597
public void addPath(String path, Mode mode)
    {
        PathHolder pathHolder = new PathHolder(path, mode, 0);
        activePaths.put(path, pathHolder);
        schedule(pathHolder, reapingThresholdMs);
    }
939669
public void addInInclusionChain(final URI path, final String pointer)
            throws XIncludeFatalException
    {
        final String xincludePath = path.toASCIIString() + ((null != pointer) ? ('#' + pointer) : "");
        if (this.xincludeDeque.contains(xincludePath))
        {
            throw new XIncludeFatalException("Inclusion Loop on path: " + xincludePath);
        }
        this.xincludeDeque.addLast(xincludePath);
    }
706556
@Deprecated
    public static String setFragment(final String path, final String fragment) {
        final int i = path.indexOf(SHARP);
        final String p = i != -1 ? path.substring(0, i) : path;
        return p + (fragment != null ? (SHARP + fragment) : "");
    }
303885
public void startFragment(Fragment fragment, String tag, boolean canAddToBackstack) {
		FragmentTransaction transaction = getSupportFragmentManager().beginTransaction().replace(R.id.fragmentContainer, fragment);
		if (canAddToBackstack) {
			transaction.addToBackStack(tag);
		}
		transaction.commit();

	}
1252525
private void addFragmentToView(final int viewId, final Fragment fragment) {
    fragmentManager.beginTransaction().replace(viewId, fragment).commit();
  }
1218688
public void setPath(String strPath) throws PageException {
	if (strPath == null) return;
	this.path = ResourceUtil.toResourceNotExisting(pageContext, strPath.trim());
	// this.path=new File(path.toLowerCase().trim());

	pageContext.getConfig().getSecurityManager().checkFileLocation(this.path);

	if (!this.path.exists()) {
	    Resource parent = this.path.getParentResource();
	    if (parent != null && parent.exists()) this.path.mkdirs();
	    else {
		throw new ApplicationException("attribute path of the tag collection must be a existing directory");
	    }
	}
	else if (!this.path.isDirectory()) throw new ApplicationException("attribute path of the tag collection must be a existing directory");
    }
975333
private void updateCachedLayout(
            Document layout, IUserProfile profile, FragmentDefinition fragment) {
        final Locale locale = profile.getLocaleManager().getLocales().get(0);
        // need to make a copy that we can fragmentize
        layout = (Document) layout.cloneNode(true);

        // Fix later to handle multiple profiles
        final Element root = layout.getDocumentElement();
        final UserView userView = this.fragmentUtils.getUserView(fragment, locale);
        if (userView == null) {
            throw new IllegalStateException(
                    "No UserView found for fragment: " + fragment.getName());
        }

        root.setAttribute(
                Constants.ATT_ID,
                Constants.FRAGMENT_ID_USER_PREFIX
                        + userView.getUserId()
                        + Constants.FRAGMENT_ID_LAYOUT_PREFIX
                        + "1");
        try {
            this.fragmentActivator.clearChacheForOwner(fragment.getOwnerId());
            this.fragmentUtils.getUserView(fragment, locale);
        } catch (final Exception e) {
            logger.error("An exception occurred attempting to update a layout.", e);
        }
    }
527829
public void insertNames(Object allNames[], String path) {
        String names[][] = (String[][])allNames[2];
        String main = null;
        for (int k = 0; k < names.length; ++k) {
            String name[] = names[k];
            if (name[2].equals("1033")) {
                main = name[3];
                break;
            }
        }
        if (main == null)
            main = names[0][3];
        BaseFontParameters p = new BaseFontParameters(path);
        mapper.put(main, p);
        for (int k = 0; k < names.length; ++k) {
            aliases.put(names[k][3], main);
        }
        aliases.put(allNames[0], main);
    }
45070
public void setPath(String path) {
        this.path = path;
        if (null != path) {
            int i = path.lastIndexOf('.');
            if (i == path.length() - 4) {
                i = path.lastIndexOf('/');
                String p = path.substring(0, i);
                String f = path.substring(i + 1);
                recorder.setPath(p);
                recorder.setName(f);
            } else {
                recorder.setPath(path);
                //recorder.setName(VoiceRecorder.generateName());
            }
        }
    }