Writes entities in a sub folder.
@param subFolder the folder (to create) in which the JHipster entity folder will be.
552034
function writeEntities(subFolder) {
  for (let i = 0, entityNames = Object.keys(configuration.entities); i < entityNames.length; i++) {
    const filePath = path.join(subFolder, toFilePath(entityNames[i]));
    const entity = updateChangelogDate(filePath, configuration.entities[entityNames[i]]);
    fs.writeFileSync(filePath, JSON.stringify(entity, null, 4));
  }
}
1306256
public void exportArtifacts(SessionProvider sp, FolderDescriptor parentFolder, OutputStream out)
            throws RepositoryException, FileNotFoundException
   {

      Session session = currentSession(sp);
      Node parentNode;
      if (rootNodePath.length() > 1)
      {
         parentNode = (Node) session.getItem(rootNodePath + "/" + parentFolder.getAsPath());
      }
      else
      {
         parentNode = (Node) session.getItem("/" + parentFolder.getAsPath());
      }

      LOG.info("Write repository to zipped stream");

      ZipOutputStream zout = new ZipOutputStream(new BufferedOutputStream(out, BUFFER));
      try
      {
         mapRepositoryToZipStream(parentNode, zout);
         zout.flush();
         zout.close();
      }
      catch (IOException e)
      {
         LOG.error("Cannot write to zip stream", e);
      }

   }
420347
private void writeKind(JsonGenerator jsonGenerator, Object entity) throws IOException {
        jsonGenerator.writeFieldName(KIND);
        if (entity instanceof EntitySet) {
            jsonGenerator.writeObject(ENTITY_SET);
        } else {
            jsonGenerator.writeObject(SINGLETON);
        }
    }
281653
protected void writeFile(String subdir, String filename, String content) throws IOException {
        Path dir = root;
        if (subdir != null) {
            dir = dir.resolve(subdir);

            // If the dir does not exist, we need to create it
            if (Files.notExists(dir)) {
                Files.createDirectory(dir);
            }
        }
        Files.write(dir.resolve(filename), content.getBytes(StandardCharsets.UTF_8));
    }
593946
final void writeHeader()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "writeHeader");

        byteArrayOutputStream.reset();
        java.io.DataOutputStream dataOutputStream = new java.io.DataOutputStream(byteArrayOutputStream);

        // Write the header.
        try {
            dataOutputStream.writeInt(version);
            dataOutputStream.writeChars(signature);
            dataOutputStream.writeLong(objectStoreIdentifier);
            dataOutputStream.writeLong(((Directory.Node) directory.root).byteAddress);
            dataOutputStream.writeLong(((Directory.Node) directory.root).length);
            dataOutputStream.writeInt(directory.getMinimumNodeSize());
            if (freeSpaceStoreArea == null) {
                dataOutputStream.writeLong(0);
                dataOutputStream.writeLong(0);
            } else {
                dataOutputStream.writeLong(freeSpaceStoreArea.byteAddress);
                dataOutputStream.writeLong(freeSpaceStoreArea.length);
            }
            dataOutputStream.writeLong((long) freeSpaceByLength.size());
            dataOutputStream.writeLong(sequenceNumber);
            dataOutputStream.writeLong(storeFileSizeUsed);
            dataOutputStream.writeLong(minimumStoreFileSize);
            dataOutputStream.writeLong(maximumStoreFileSize);
            dataOutputStream.writeInt(cachedManagedObjectsSize);

            dataOutputStream.flush();
            byteArrayOutputStream.flush();
        } catch (java.io.IOException exception) {
            // No FFDC Code Needed.
            ObjectManager.ffdc.processException(this, cclass, "writeHeader", exception, "1:836:1.35");

            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           "flush");
            throw new PermanentIOException(this,
                                           exception);
        } // catch.

        byte[] buffer = byteArrayOutputStream.getBuffer();
        int length = byteArrayOutputStream.getCount();
        writeBuffer(buffer,
                    0,
                    length,
                    0);
        // Write the header twice.
        writeBuffer(buffer,
                    0,
                    length,
                    pageSize);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "writeHeader"
                            );
    }
29734
public void getSubFolders(final String folder, final AsyncCallback<List<CmsVfsEntryBean>> callback) {

        CmsRpcAction<List<CmsVfsEntryBean>> action = new CmsRpcAction<List<CmsVfsEntryBean>>() {

            @Override
            public void execute() {

                start(0, false);
                getGalleryService().getSubFolders(folder, this);
            }

            @Override
            protected void onResponse(List<CmsVfsEntryBean> result) {

                stop(false);
                callback.onSuccess(result);
            }

        };
        action.execute();
    }
1205968
public void setEntityTypes(java.util.Collection<EntityTypesListItem> entityTypes) {
        if (entityTypes == null) {
            this.entityTypes = null;
            return;
        }

        this.entityTypes = new java.util.ArrayList<EntityTypesListItem>(entityTypes);
    }
922480
public void setSubResources(java.util.Collection<SubResourceSummary> subResources) {
        if (subResources == null) {
            this.subResources = null;
            return;
        }

        this.subResources = new java.util.ArrayList<SubResourceSummary>(subResources);
    }
1105403
private void writePackageInfos( File rootDir, File outputDir )
        throws MojoExecutionException
    {
        getLog().debug( "in writePackageInfos(" + rootDir + ", " + outputDir + ")" );

        try
        {
            if ( shouldWritePackageInfo( rootDir ) )
            {
                if( !outputDir.exists() && !outputDir.mkdirs() ) {
                    throw new MojoExecutionException( "outputDirectory was unable to be created: " + outputDir );
                }

                writePackageInfo( outputDir );
            }
            else
            {
                getLog().debug( "no files in:" + rootDir );
            }

        }
        catch ( Throwable e )
        {
            throw new MojoExecutionException( "could not write PackageInfo.java in: " + outputDir, e );
        }

        // get any sub-directories
        File[] subdirs = rootDir.listFiles( new FileFilter()
        {
            public boolean accept( File pathname )
            {
                return pathname.isDirectory();
            }
        } );

        // recurse
        if ( subdirs != null ) {
            for (File subdir : subdirs) {
                writePackageInfos(subdir, new File(outputDir, subdir.getName()));
            }
        }
    }
472257
private static void addFolderPropertyDefinitions(FolderTypeDefinitionImpl type) {

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.PARENT_ID,
                "Parent Id",
                "Parent Id",
                PropertyType.ID,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS,
                "Allowed Child Object Type Ids",
                "Allowed Child Object Type Ids",
                PropertyType.ID,
                Cardinality.MULTI,
                Updatability.READONLY,
                false,
                false));

        type.addPropertyDefinition(
            createPropDef(
                PropertyIds.PATH,
                "Path",
                "Path",
                PropertyType.STRING,
                Cardinality.SINGLE,
                Updatability.READONLY,
                false,
                false));
    }
1357811
private void writeEntitySets(XMLStreamWriter writer) throws XMLStreamException, ODataRenderException {
        List<EntitySet> entitySets = getEntityContainer().getEntitySets();
        LOG.debug("Number of entity sets to be written in service document are {}", entitySets.size());
        for (EntitySet entitySet : entitySets) {
            if (entitySet.isIncludedInServiceDocument()) {
                writeElement(writer, null, SERVICE_COLLECTION, null, entitySet.getName(), entitySet.getName());
            }
        }
    }
1156640
public void addFolder(String folder) {

        m_searchObject.addFolder(folder);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
636596
void writeTree() throws DocumentException {
		// MBeans pour la plateforme
		margin = 0;
		final MBeanNode platformNode = mbeans.get(0);
		writeTree(platformNode.getChildren());

		for (final MBeanNode node : mbeans) {
			if (node != platformNode) {
				newPage();
				addToDocument(new Chunk(node.getName(), boldFont));
				margin = 0;
				writeTree(node.getChildren());
			}
		}
	}
989286
private void writeODataType(StructuredType structuredType) throws IOException {
        if (entitySet != null) {
            String typeName = entitySet.getTypeName();
            String type = typeName.substring(typeName.lastIndexOf(".") + 1, typeName.length());

            if (!type.equals(structuredType.getName())) {
                jsonGenerator.writeStringField(TYPE, String.format("#%s.%s",
                        structuredType.getNamespace(), structuredType.getName()));
            } else {
                LOG.trace("{} has root level. {} won't be written here", entitySet.getName(), TYPE);
            }
        }
    }
610492
private void createPropertiesFolder() throws IOException {
        if(!Files.exists(propertiesLocation.toPath()))
            Files.createDirectories(propertiesLocation.toPath());
    }
1211399
private void serializeEntityDocument(EntityDocument entityDocument) {
		try {
			if (this.entityDocumentCount > 0) {
				this.outputStream.write(JSON_SEP);
			}
			mapper.writeValue(this.outputStream, entityDocument);
		} catch (IOException e) {
			reportException(e);
		}
		this.entityDocumentCount++;
	}
114592
public void write(final File folder) throws IOException {
    try (final DataInputStream keyStream = entry.getKeyStream();
         final DataInputStream valueStream = entry.getValueStream();) {
      final String containerId = keyStream.readUTF();
      try (final Writer outputWriter = new OutputStreamWriter(
          new FileOutputStream(new File(folder, containerId + ".txt")), StandardCharsets.UTF_8)) {
        this.writeFiles(valueStream, outputWriter);
      }
    }
  }