Create logging.properties file in the {@link SeLionConstants#SELION_HOME_DIR}

@param type
{@link InstanceType}

@throws IOException
977819
static void createLoggingPropertiesFile(InstanceType type) throws IOException {
        LOGGER.entering(type);

        String installedFile = LOGGING_PROPERTIES_FILE + "." + type.getFriendlyName();
        if (!new File(installedFile).exists()) {

            // Need to change the backward slash to forward, so that logger able to locate path in windows
            String logPath = LOGS_DIR.replace("\\", "/");

            String value = IOUtils.toString(JarSpawner.class.getResourceAsStream(LOGGING_PROPERTIES_FILE_RESOURCE),
                    "UTF-8");
            value = value.concat("\njava.util.logging.FileHandler.pattern=" + logPath + "selion-grid-" + type.getFriendlyName()
                    + "-%g.log");
            FileUtils.writeStringToFile(new File(installedFile), value, "UTF-8");
            LOGGER.fine("Logger file created successfully. Path is " + installedFile);
        }

        LOGGER.exiting();
    }
365013
public static void writeClass(@NonNull Filer filer, @NonNull TypeSpec typeSpec) throws IOException {
        JavaFile.builder(PACKAGE, typeSpec)
                .skipJavaLangImports(true)
                .indent("    ")
                .addFileComment("Copyright (c) " + Calendar.getInstance().get(Calendar.YEAR) + "\n\n" +
                        "Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
                        "you may not use this file except in compliance with the License.\n\n" +
                        "http://www.apache.org/licenses/LICENSE-2.0\n\n" +
                        "Unless required by applicable law or agreed to in writing, software\n" +
                        "distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
                        "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
                        "See the License for the specific language governing permissions and\n" +
                        "limitations under the License.")
                .build()
                .writeTo(filer);
    }
542622
@ExportInstanceMethod
	public static GeometryIndex create(GeometryIndexService instance, String type, int[] values) {
		if ("geometry".equalsIgnoreCase(type)) {
			return instance.create(GeometryIndexType.TYPE_GEOMETRY, values);
		} else if ("vertex".equalsIgnoreCase(type)) {
			return instance.create(GeometryIndexType.TYPE_VERTEX, values);
		} else if ("edge".equalsIgnoreCase(type)) {
			return instance.create(GeometryIndexType.TYPE_EDGE, values);
		}
		return null;
	}
1332993
public static <T> T newInstance(Type type) {
        try {
            Class<T> clazz = (Class<T>) getClass(type);
            if (clazz == null) {
                return null;
            }
            return clazz.newInstance();
        } catch (Exception e) {
            log.warn("new instance fail :{}", e.getCause().toString());
            throw new NewInstanceException(e.getCause().toString());
        }
    }
1259802
public static void save( File f, ApplicationTemplateDescriptor descriptor ) throws IOException {

		Properties properties = new Properties();
		if( descriptor.name != null )
			properties.setProperty( APPLICATION_NAME, descriptor.name );

		if( descriptor.version != null )
			properties.setProperty( APPLICATION_VERSION, descriptor.version );

		if( descriptor.dslId != null )
			properties.setProperty( APPLICATION_DSL_ID, descriptor.dslId );

		if( descriptor.description != null )
			properties.setProperty( APPLICATION_DESCRIPTION, descriptor.description );

		if( descriptor.graphEntryPoint != null )
			properties.setProperty( APPLICATION_GRAPH_EP, descriptor.graphEntryPoint );

		if( descriptor.instanceEntryPoint != null )
			properties.setProperty( APPLICATION_INSTANCES_EP, descriptor.instanceEntryPoint );

		if( descriptor.externalExportsPrefix != null )
			properties.setProperty( APPLICATION_EXTERNAL_EXPORTS_PREFIX, descriptor.externalExportsPrefix );

		StringBuilder sb = new StringBuilder();
		for( Iterator<Map.Entry<String,String>> it = descriptor.externalExports.entrySet().iterator(); it.hasNext(); ) {
			Map.Entry<String,String> entry = it.next();
			sb.append( entry.getKey());
			sb.append( " " );
			sb.append( APPLICATION_EXTERNAL_EXPORTS_AS );
			sb.append( " " );
			sb.append( entry.getValue());
			if( it.hasNext())
				sb.append( ", " );
		}

		if( sb.length() > 0 )
			properties.setProperty( APPLICATION_EXTERNAL_EXPORTS, sb.toString());

		properties.setProperty( APPLICATION_TAGS, Utils.format( descriptor.tags, ", " ));
		Utils.writePropertiesFile( properties, f );
	}
521154
public void setParameterType(String type) {
		String typeName;
		if (Strings.isEmpty(type)) {
			typeName = Object.class.getName();
		} else {
			typeName = type;
		}
		this.parameter.setParameterType(newTypeRef(this.context, typeName));
	}
513231
@SuppressWarnings("unchecked")
    public <T> PathBuilder<T> create(Class<T> type) {
        PathBuilder<T> rv = (PathBuilder<T>) paths.get(type);
        if (rv == null) {
            rv = new PathBuilder<T>(type, variableName(type));
            paths.put(type, rv);
        }
        return rv;
    }
634274
protected <A, E> ArrayPath<A, E> createArray(String property, Class<? super A> type) {
        return add(new ArrayPath<A, E>(type, forProperty(property)));
    }
776334
public void registerType(ModelElementType modelElementType, Class<? extends ModelElementInstance> instanceType) {
    QName qName = ModelUtil.getQName(modelElementType.getTypeNamespace(), modelElementType.getTypeName());
    typesByName.put(qName, modelElementType);
    typesByClass.put(instanceType, modelElementType);
  }
210424
public JSType createFunctionTypeWithInstanceType(ObjectType instanceType,
      JSType returnType, List<JSType> parameterTypes) {
    Node paramsNode = createParameters(parameterTypes.toArray(new JSType[parameterTypes.size()]));
    return FunctionType.builder(this)
        .withParamsNode(paramsNode)
        .withReturnType(returnType)
        .withTypeOfThis(instanceType)
        .build();
  }
21587
public static void saveAll(final Object obj, final PersistenceStoreType storeType) {

        try {

            File file = new File(persistenceStorePath + File.separator + storeType);

            // create necessary parent directories on file system
            File directory = file.getParentFile();
            if (null != directory && !directory.exists()) {
                directory.mkdirs();
            }

            log.info("aws-mock: saving to {}", file.getAbsolutePath());

            ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file, false));
            out.writeObject(obj);
            out.close();
        } catch (FileNotFoundException e) {
            log.error("FileNotFoundException caught during saving object to file: {}",
                    e.getMessage());
        } catch (IOException e) {
            log.error("IOException caught during saving object to file: {}", e.getMessage());
        }

    }
1183593
function(type) {
            var args = Array.prototype.slice.call(arguments, 1);
            var level = configs.logLevels[this.namespace] || configs.logLevel;

            if (this.logLevel(type) < this.logLevel(level)) {
                return this;
            }
            args.splice(0, 0, "[" + this.namespace + "] [" + type + "]");
            var logMethod = Function.prototype.bind.call(this.handler[type], this.handler);
            logMethod.apply(this.handler[type], args);
        }
11131
public static void deleteInstanceResources( Instance instance )	throws IOException {
		File dir = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
		Utils.deleteFilesRecursively( dir );
	}
1052307
public void setFileTypeOrName(String type) {
        fileTypeOrName = type;
        if ((fileAsBufferedImage != null) && !ImageIO.getImageWritersByFormatName(getFileType()).hasNext()) {
            throw new IllegalArgumentException(String.format("No image writer found for format \"%s\"", getFileType()));
        }
    }
437117
@SuppressWarnings("unchecked")
	public <T> DatagraphEnvironment setInstance(Class<T> type, T value) {
		((Map<Class<T>, T>) instances).put(type, value);
		return this;
	}
1266190
public static <T> CopyOnWriteList<T> createCopyOnWriteList(final Class<T> type) {
        return new CopyOnWriteList<T>() {
            private ExtensionList<T> storage() {
                return Jenkins.getInstance().getExtensionList(type);
            }

            @Override
            public void add(T t) {
                storage().add(t);
            }

            @Override
            public boolean remove(T t) {
                return storage().remove(t);
            }

            @Override
            public Iterator<T> iterator() {
                return storage().iterator();
            }

            @Override
            public void replaceBy(CopyOnWriteList<? extends T> that) {
                throw new UnsupportedOperationException();
            }

            @Override
            public void replaceBy(Collection<? extends T> that) {
                throw new UnsupportedOperationException();
            }

            @Override
            public void replaceBy(T... that) {
                throw new UnsupportedOperationException();
            }

            @Override
            public void clear() {
                throw new UnsupportedOperationException();
            }

            @Override
            public <T> T[] toArray(T[] array) {
                return storage().toArray(array);
            }

            @Override
            public List<T> getView() {
                return storage();
            }

            @Override
            public void addAllTo(Collection<? super T> dst) {
                dst.addAll(storage());
            }

            @Override
            public boolean isEmpty() {
                return storage().isEmpty();
            }
        };
    }
317783
public void declarePrototypeProperty(String name, JSType type, Node defSite) {
    prototype.defineDeclaredProperty(name, type, defSite);
  }