Generates a map of all client-side default content properties to be
added with new content.

@param absolutePath
@param creator
@return
4962
public static Map<String, String> createContentProperties(String absolutePath,
                                                              String creator) {

        Map<String, String> props = new HashMap<String, String>();
        if (creator != null && creator.trim().length() > 0) {
            props.put(StorageProvider.PROPERTIES_CONTENT_CREATOR, creator);
        }

        props.put(StorageProvider.PROPERTIES_CONTENT_FILE_PATH, absolutePath);

        try {
            Path path = FileSystems.getDefault().getPath(absolutePath);

            BasicFileAttributes bfa =
                Files.readAttributes(path, BasicFileAttributes.class);

            String creationDate =
                DateUtil.convertToStringLong(bfa.creationTime().toMillis());
            props.put(StorageProvider.PROPERTIES_CONTENT_FILE_CREATED, creationDate);

            String lastAccessed =
                DateUtil.convertToStringLong(bfa.lastAccessTime().toMillis());
            props.put(StorageProvider.PROPERTIES_CONTENT_FILE_LAST_ACCESSED, lastAccessed);

            String modified =
                DateUtil.convertToStringLong(bfa.lastModifiedTime().toMillis());
            props.put(StorageProvider.PROPERTIES_CONTENT_FILE_MODIFIED, modified);

        } catch (IOException ex) {
            log.error("Failed to read basic file attributes from "
                      + absolutePath + ": " + ex.getMessage(), ex);
        }

        return props;
    }
680456
@Override
    public T addAsWebInfResource(final Asset resource, final ArchivePath target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        Validate.notNull(target, "Target should be specified");

        final ArchivePath location = new BasicPath(getWebInfPath(), target);
        return add(resource, location);
    }
25568
public void copyProviderToCreator(Resource.Provider provider,
                                      Resource.Creator creator) {
        provider.stream().forEach((ConsumerWithThrowable<Resource.Readable, IOException>) resource ->
                copyResourceWithStreams(resource, creator.create(resource.getPath())));
    }
451269
public static String toAbsoluteUrl(String absoluteBasePath, String relativePath) {
		try {
			URL absoluteUrl = new URL(absoluteBasePath);
			return new URL(absoluteUrl, relativePath).toString();
		} catch (Exception e) {
			throw new UtilException(e, "To absolute url [{}] base [{}] error!", relativePath, absoluteBasePath);
		}
	}
785714
public void addFile(String path, InputStream inputStream, String contentType) throws IOException {
    String fullPath = buildJcrPathForZip(path);
    writeBinaryFile(fullPath, inputStream);

    if (StringUtils.isNotEmpty(contentType)) {
      String mimeType = StringUtils.substringBefore(contentType, CONTENT_TYPE_CHARSET_EXTENSION);
      String encoding = StringUtils.substringAfter(contentType, CONTENT_TYPE_CHARSET_EXTENSION);

      String fullPathMetadata = fullPath + DOT_DIR_FOLDER + "/" + DOT_CONTENT_XML;
      Document doc = xmlContentBuilder.buildNtFile(mimeType, encoding);
      writeXmlDocument(fullPathMetadata, doc);
    }
  }
1295175
@Override
  protected Outlet createOutlet(final boolean append, final String encoding, final String name, final boolean overwrite, final String path) {
    Outlet _xifexpression = null;
    if (((Objects.equal(name, Generator.SRC_GEN) || Objects.equal(name, Generator.SRC_GEN_IDE)) || Objects.equal(name, Generator.SRC_GEN_UI))) {
      _xifexpression = super.createOutlet(append, encoding, name, overwrite, this.getTmpFolder().getAbsolutePath());
    } else {
      _xifexpression = super.createOutlet(append, encoding, name, overwrite, path);
    }
    return _xifexpression;
  }
638130
@Override
	protected Reader generateResource(String path, GeneratorContext context) {

		Reader rd = null;

		try {
			List<Class<?>> excluded = new ArrayList<>();
			excluded.add(ISassResourceGenerator.class);
			JoinableResourceBundle bundle = context.getBundle();
			rd = context.getResourceReaderHandler().getResource(bundle, path, false, excluded);

			if (rd == null) {
				throw new ResourceNotFoundException(path);
			}
			String content = IOUtils.toString(rd);

			String result = compile(bundle, content, path, context);
			rd = new StringReader(result);

		} catch (ResourceNotFoundException | IOException e) {
			throw new BundlingProcessException("Unable to generate content for resource path : '" + path + "'", e);
		}

		return rd;
	}
1339309
public int addDefaultAttribute(String localName, String uri, String prefix,
                                   String value) throws XMLStreamException
    {
        int attrIndex = mAttrCount;
        if (attrIndex < 1) {
            /* had no explicit attributes... better initialize now, then.
             * Let's just use hash area of 4, and 
             */
            initHashArea();
        }

        /* Ok, first, since we do want to verify that we can not accidentally
         * add duplicates, let's first try to add entry to Map, since that
         * will catch dups.
         */
        int hash = localName.hashCode();
        if (uri != null && uri.length() > 0) {
            hash ^= uri.hashCode();
        }
        int index = hash & (mAttrHashSize - 1);
        int[] map = mAttrMap;
        if (map[index] == 0) { // whoa, have room...
            map[index] = attrIndex+1; // add 1 to get 1-based index (0 is empty marker)
        } else { // nah, collision...
            int currIndex = map[index]-1; // Index of primary collision entry
            int spillIndex = mAttrSpillEnd;
            map = spillAttr(uri, localName, map, currIndex, spillIndex,
                            hash, mAttrHashSize);
            if (map == null) { // dup!
                return -1; // could return negation (-(index+1)) of the prev index?
            }
            map[++spillIndex] = attrIndex; // no need to specifically avoid 0
            mAttrMap = map;
            mAttrSpillEnd = ++spillIndex;
        }

        /* Can reuse code; while we don't really need the builder,
         * we need to add/reset attribute
         */
        getAttrBuilder(prefix, localName);
        Attribute attr = mAttributes[mAttrCount-1];
        attr.mNamespaceURI = uri;
        attr.setValue(value);
        // attribute count has been updated; index is one less than count
        return (mAttrCount-1);
    }
974523
public DocumentDbFactory createDocumentDbFactory(final BaseCosmosDbProperties properties) {
        val documentClient = createDocumentClient(properties);
        return new DocumentDbFactory(documentClient);
    }
450960
public static CmsBasicFormField createField(
        CmsXmlContentProperty propertyConfig,
        Map<String, String> additionalParams) {

        return createField(
            propertyConfig,
            propertyConfig.getName(),
            CmsWidgetFactoryRegistry.instance(),
            additionalParams,
            false);
    }
32741
public static AssetVersionCreator creator(final String pathServiceSid, 
                                              final String pathAssetSid, 
                                              final String path, 
                                              final AssetVersion.Visibility visibility) {
        return new AssetVersionCreator(pathServiceSid, pathAssetSid, path, visibility);
    }
1101813
private void configureClientFactories()
    {
        ClientMetadataBuilder builder = new ClientMetadataBuilder(getProperties(), kunderaMetadata,
                getPersistenceUnits());
        builder.buildClientFactoryMetadata(clientFactories, kunderaMetadata);
    }
1206861
public static Map<String, Object> generateMap(InputStream inputStream) {
        logger.trace("Converting XML document [{}]");
        Map<String, Object> map = asMap(inputStream);

        logger.trace("Generated JSON: {}", map);
        return map;
    }
719134
public void store(String absolutePath) {
		if (null == this.settingLoader) {
			settingLoader = new SettingLoader(this.groupedMap, this.charset, this.isUseVariable);
		}
		settingLoader.store(absolutePath);
	}
264613
@Override
    public T add(final Archive<?> archive, final ArchivePath path, Class<? extends StreamExporter> exporter) {
        // Precondition checks
        Validate.notNull(path, "No path was specified");
        Validate.notNull(archive, "No archive was specified");
        Validate.notNull(exporter, "No exporter was specified");

        // Make a Path
        final String archiveName = archive.getName();
        final ArchivePath contentPath = new BasicPath(path, archiveName);

        // Create ArchiveAsset
        final ArchiveAsset archiveAsset = new ArchiveAsset(archive, exporter);

        // Delegate
        return add(archiveAsset, contentPath);
    }
1203817
public static DefaultFileSet.Builder with(BaseFolder baseFolder, AnnotatedFile manifest) {
		return new Builder(baseFolder, manifest);
	}
986287
public ContentAssistContext.Builder copy() {
		Builder result = builderProvider.get();
		result.copyFrom(this);
		return result;
	}