Create a new folder in Dropbox.

@return
If successful, returns the metadata for the newly created folder, otherwise
returns {@code null}.
331508
public DbxEntry./*@Nullable*/Folder createFolder(String path)
        throws DbxException
    {
        DbxPathV1.checkArgNonRoot("path", path);

        String[] params = {
            "root", "auto",
            "path", path,
        };

        return doPost(host.getApi(), "1/fileops/create_folder", params, null, new DbxRequestUtil.ResponseHandler<DbxEntry./*@Nullable*/Folder>() {
            @Override
            public DbxEntry./*@Nullable*/Folder handle(HttpRequestor.Response response)
                throws DbxException
            {
                if (response.getStatusCode() == 403) return null;
                if (response.getStatusCode() != 200) throw DbxRequestUtil.unexpectedStatus(response);
                return DbxRequestUtil.readJsonFromResponse(DbxEntry.Folder.Reader, response);
            }
        });
    }
1286363
static void createGeneratedFilesDirectory(String apiName) {
        File folder = new File(getDestinationDirectory(apiName));

        if (!folder.exists()){
            //noinspection ResultOfMethodCallIgnored
            folder.mkdirs();
        }
    }
401079
@NonNull
    public <T> T create(@NonNull Class<? extends T> clazz, @NonNull Fallback<T> fallback) {
        T t = create(clazz);
        return t != null ? t : fallback.get();
    }
969026
public function getFolder()
    {
        if (is_null($this->_folder)) {
            $this->_folder = new Folder(
                array(
                    'name' => "{$this->_path}/{$this->_dirName}",
                    'autoCreate' => true
                )
            );
        }
        return $this->_folder;
    }
16615
public FileIOChannel.ID createChannel() {
		final int num = getNextPathNum();
		return new FileIOChannel.ID(this.paths[num], num, this.random);
	}
1252996
@SuppressWarnings("deprecation")
    public CmsResource createFolder(String targetFolder, String folderName) throws Exception {

        if (m_cms.existsResource(targetFolder + folderName)) {
            m_shell.getOut().println(
                getMessages().key(Messages.GUI_SHELL_FOLDER_ALREADY_EXISTS_1, targetFolder + folderName));
            return null;
        }
        return m_cms.createResource(targetFolder + folderName, CmsResourceTypeFolder.getStaticTypeId());
    }
631026
public GetFolderResult withCustomMetadata(java.util.Map<String, String> customMetadata) {
        setCustomMetadata(customMetadata);
        return this;
    }
610492
private void createPropertiesFolder() throws IOException {
        if(!Files.exists(propertiesLocation.toPath()))
            Files.createDirectories(propertiesLocation.toPath());
    }
40671
static <S extends Storable> BlobReplicationTrigger<S> create(Storage<S> masterStorage) {
        Map<String, ? extends StorableProperty<S>> properties = 
            StorableIntrospector.examine(masterStorage.getStorableType()).getDataProperties();

        List<String> blobNames = new ArrayList<String>(2);

        for (StorableProperty<S> property : properties.values()) {
            if (property.getType() == Blob.class) {
                blobNames.add(property.getName());
            }
        }

        if (blobNames.size() == 0) {
            return null;
        }

        return new BlobReplicationTrigger<S>(masterStorage,
                                             blobNames.toArray(new String[blobNames.size()]));
    }
623343
private File createWorkingDirectory( String workingDirectoryOption )
    {
        final File workDir = new File( workingDirectoryOption );
        // create if not existent:
        if( !workDir.exists() )
        {
            workDir.mkdirs();
        }
        if( m_workingFolder == null )
        {
            m_workingFolder = workDir;
        }
        return workDir;
    }
1371729
private void createFolder(String foldername, int position, Hashtable properties) {

        String vfsFolderName = (String)m_fileIndex.get(foldername.replace('\\', '/'));

        m_report.print(Messages.get().container(Messages.RPT_CREATE_FOLDER_0), I_CmsReport.FORMAT_NOTE);
        m_report.print(
            org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_ARGUMENT_1, vfsFolderName));
        m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));

        if (vfsFolderName != null) {
            String path = vfsFolderName.substring(
                0,
                vfsFolderName.substring(0, vfsFolderName.length() - 1).lastIndexOf("/"));
            String folder = vfsFolderName.substring(path.length(), vfsFolderName.length());
            try {
                // try to find a meta.properties file in the folder
                String propertyFileName = foldername + File.separator + META_PROPERTIES;

                boolean metaPropertiesFound = false;
                CmsParameterConfiguration propertyFile = new CmsParameterConfiguration();
                try {
                    propertyFile.load(new FileInputStream(new File(propertyFileName)));
                    metaPropertiesFound = true;
                } catch (Exception e1) {
                    // do nothing if the property file could not be loaded since it is not required
                    // that such s file does exist
                }
                // now copy all values from the property file to the already found properties of the
                // new folder in OpenCms
                // only do this if we have found a meta.properties file
                if (metaPropertiesFound) {
                    properties.putAll(propertyFile);

                    // check if we have to set the navpos property.
                    if (properties.get(CmsPropertyDefinition.PROPERTY_NAVPOS) == null) {
                        // set the position in the folder as navpos
                        // we have to add one to the position, since it is counted from 0
                        properties.put(CmsPropertyDefinition.PROPERTY_NAVPOS, (position + 1) + "");
                    }
                    // check if we have to set the navpos property.
                    if (properties.get(CmsPropertyDefinition.PROPERTY_NAVTEXT) == null) {
                        // set the foldername in the folder as navtext
                        String navtext = folder.substring(1, 2).toUpperCase()
                            + folder.substring(2, folder.length() - 1);
                        properties.put(CmsPropertyDefinition.PROPERTY_NAVTEXT, navtext);
                    }
                } else {
                    // if there was no meta.properties file, no properties should be added to the
                    // folder
                    properties = new Hashtable();
                }
                // try to read the folder, it its there we must not create it again
                try {
                    m_cmsObject.readFolder(path + folder);
                    m_cmsObject.lockResource(path + folder);
                } catch (CmsException e1) {
                    // the folder was not there, so create it
                    m_cmsObject.createResource(
                        path + folder,
                        OpenCms.getResourceManager().getResourceType(
                            CmsResourceTypeFolder.getStaticTypeName()).getTypeId());
                }
                // create all properties and put them in an ArrayList
                Enumeration enu = properties.keys();
                List propertyList = new ArrayList();
                while (enu.hasMoreElements()) {
                    // get property and value
                    String propertyKey = (String)enu.nextElement();
                    String propertyVal = (String)properties.get(propertyKey);
                    CmsProperty property = new CmsProperty(propertyKey, propertyVal, propertyVal);
                    // create implicitly if Property doesn't exist already
                    property.setAutoCreatePropertyDefinition(true);
                    // add new property to the list
                    propertyList.add(property);
                }
                // try to write the property Objects
                try {
                    m_cmsObject.writePropertyObjects(path + folder, propertyList);
                } catch (CmsException e1) {
                    e1.printStackTrace();
                }
                m_report.println(
                    org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                    I_CmsReport.FORMAT_OK);
            } catch (CmsException e) {
                m_report.println(e);
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
    }
694401
@Override
  public CloudStorageFileSystem getFileSystem(URI uri) {
    initStorage();
    return newFileSystem(uri, Collections.<String, Object>emptyMap());
  }
1125289
public BoxFolder.Info createFolder(String name) {
        JsonObject parent = new JsonObject();
        parent.add("id", this.getID());

        JsonObject newFolder = new JsonObject();
        newFolder.add("name", name);
        newFolder.add("parent", parent);

        BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), CREATE_FOLDER_URL.build(this.getAPI().getBaseURL()),
                "POST");
        request.setBody(newFolder.toString());
        BoxJSONResponse response = (BoxJSONResponse) request.send();
        JsonObject responseJSON = JsonObject.readFrom(response.getJSON());

        BoxFolder createdFolder = new BoxFolder(this.getAPI(), responseJSON.get("id").asString());
        return createdFolder.new Info(responseJSON);
    }
923984
public File getPropsFile() {
		String homedir = System.getProperty("user.home"); //$NON-NLS-1$
		String filename = getPropsFilename();
		return filename != null ? new File(homedir, filename) : null;
	}
1005358
public function onCreateFolder()
    {
        $this->abortIfReadOnly();

        $name = trim(Input::get('name'));
        if (!strlen($name)) {
            throw new ApplicationException(Lang::get('cms::lang.asset.name_cant_be_empty'));
        }

        if (!$this->validateFileName($name)) {
            throw new ApplicationException(Lang::get('cms::lang.asset.invalid_name'));
        }

        $path = Input::get('path');
        $path = MediaLibrary::validatePath($path);

        $newFolderPath = $path.'/'.$name;

        $library = MediaLibrary::instance();

        if ($library->folderExists($newFolderPath)) {
            throw new ApplicationException(Lang::get('backend::lang.media.folder_or_file_exist'));
        }

        /*
         * Create the new folder
         */
        if (!$library->makeFolder($newFolderPath)) {
            throw new ApplicationException(Lang::get('backend::lang.media.error_creating_folder'));
        }

        /**
         * @event media.folder.create
         * Called after a folder is created
         *
         * Example usage:
         *
         *     Event::listen('media.folder.create', function((\Backend\Widgets\MediaManager) $mediaWidget, (string) $newFolderPath) {
         *         \Log::info($newFolderPath . " was created");
         *     });
         *
         * Or
         *
         *     $mediaWidget->bindEvent('folder.create', function ((string) $newFolderPath) {
         *         \Log::info($newFolderPath . " was created");
         *     });
         *
         */
        $this->fireSystemEvent('media.folder.create', [$newFolderPath]);

        $library->resetCache();

        $this->prepareVars();

        return [
            '#'.$this->getId('item-list') => $this->makePartial('item-list')
        ];
    }
1335385
public File getDir() {
		if (this.dir == null) {
			synchronized (this) {
				byte[] hash = generateHash(this.sourceClass);
				this.dir = new File(getTempDirectory(), toHexString(hash));
				this.dir.mkdirs();
				Assert.state(this.dir.exists(),
						() -> "Unable to create temp directory " + this.dir);
			}
		}
		return this.dir;
	}
886430
private boolean _create(String path, byte[] data, CreateMode createMode)
            throws ZooKeeperException {
        if (data == null) {
            data = ArrayUtils.EMPTY_BYTE_ARRAY;
        }
        try {
            curatorFramework.create().creatingParentsIfNeeded().withMode(createMode)
                    .forPath(path, data);
            _invalidateCache(path);
            return true;
        } catch (InterruptedException e) {
            return false;
        } catch (KeeperException.NodeExistsException e) {
            return false;
        } catch (KeeperException.ConnectionLossException e) {
            throw new ZooKeeperException.ClientDisconnectedException();
        } catch (Exception e) {
            if (e instanceof ZooKeeperException) {
                throw (ZooKeeperException) e;
            } else {
                throw new ZooKeeperException(e);
            }
        }
    }