text:
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
	<File path="Classes/AutoScalingCreateLaunchConfigurationRequest.html">

		<Token>
			<TokenIdentifier>//apple_ref/occ/cl/AutoScalingCreateLaunchConfigurationRequest</TokenIdentifier>
			<Abstract type="html">Create Launch Configuration Request</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/init</TokenIdentifier>
			<Abstract type="html">Default constructor for a new  object.  Callers should use the
property methods to initialize this object after creating it.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>- (id)init</Declaration>

			<Anchor>//api/name/init</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setLaunchConfigurationName:</TokenIdentifier>
			<Abstract type="html">The name of the launch configuration to create.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *launchConfigurationName</Declaration>

			<Anchor>//api/name/launchConfigurationName</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/launchConfigurationName</TokenIdentifier>
			<Abstract type="html">The name of the launch configuration to create.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *launchConfigurationName</Declaration>

			<Anchor>//api/name/launchConfigurationName</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/launchConfigurationName</TokenIdentifier>
			<Abstract type="html">The name of the launch configuration to create.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *launchConfigurationName</Declaration>

			<Anchor>//api/name/launchConfigurationName</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setImageId:</TokenIdentifier>
			<Abstract type="html">Unique ID of the Amazon Machine Image (AMI) you want to use to
launch your EC2 instances. For information about finding Amazon EC2
AMIs, see Finding
a Suitable AMI in the Amazon Elastic Compute Cloud User
Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *imageId</Declaration>

			<Anchor>//api/name/imageId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/imageId</TokenIdentifier>
			<Abstract type="html">Unique ID of the Amazon Machine Image (AMI) you want to use to
launch your EC2 instances. For information about finding Amazon EC2
AMIs, see Finding
a Suitable AMI in the Amazon Elastic Compute Cloud User
Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *imageId</Declaration>

			<Anchor>//api/name/imageId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/imageId</TokenIdentifier>
			<Abstract type="html">Unique ID of the Amazon Machine Image (AMI) you want to use to
launch your EC2 instances. For information about finding Amazon EC2
AMIs, see Finding
a Suitable AMI in the Amazon Elastic Compute Cloud User
Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *imageId</Declaration>

			<Anchor>//api/name/imageId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setKeyName:</TokenIdentifier>
			<Abstract type="html">The name of the Amazon EC2 key pair. For more information, see Getting
a Key Pair in the Amazon Elastic Compute Cloud User Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *keyName</Declaration>

			<Anchor>//api/name/keyName</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/keyName</TokenIdentifier>
			<Abstract type="html">The name of the Amazon EC2 key pair. For more information, see Getting
a Key Pair in the Amazon Elastic Compute Cloud User Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *keyName</Declaration>

			<Anchor>//api/name/keyName</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/keyName</TokenIdentifier>
			<Abstract type="html">The name of the Amazon EC2 key pair. For more information, see Getting
a Key Pair in the Amazon Elastic Compute Cloud User Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *keyName</Declaration>

			<Anchor>//api/name/keyName</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setSecurityGroups:</TokenIdentifier>
			<Abstract type="html">The security groups with which to associate Amazon EC2 or Amazon VPC
instances.
If your instances are launched in EC2, you can either
specify Amazon EC2 security group names or the security group IDs. For
more information about Amazon EC2 security groups, see
Using Security Groups in the Amazon Elastic Compute Cloud User
Guide. If your instances are launched within VPC, specify Amazon
VPC security group IDs. For more information about Amazon VPC security
groups, see Security
Groups in the Amazon Virtual Private Cloud User Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSMutableArray *securityGroups</Declaration>

			<Anchor>//api/name/securityGroups</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/securityGroups</TokenIdentifier>
			<Abstract type="html">The security groups with which to associate Amazon EC2 or Amazon VPC
instances.
If your instances are launched in EC2, you can either
specify Amazon EC2 security group names or the security group IDs. For
more information about Amazon EC2 security groups, see
Using Security Groups in the Amazon Elastic Compute Cloud User
Guide. If your instances are launched within VPC, specify Amazon
VPC security group IDs. For more information about Amazon VPC security
groups, see Security
Groups in the Amazon Virtual Private Cloud User Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSMutableArray *securityGroups</Declaration>

			<Anchor>//api/name/securityGroups</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/securityGroups</TokenIdentifier>
			<Abstract type="html">The security groups with which to associate Amazon EC2 or Amazon VPC
instances.
If your instances are launched in EC2, you can either
specify Amazon EC2 security group names or the security group IDs. For
more information about Amazon EC2 security groups, see
Using Security Groups in the Amazon Elastic Compute Cloud User
Guide. If your instances are launched within VPC, specify Amazon
VPC security group IDs. For more information about Amazon VPC security
groups, see Security
Groups in the Amazon Virtual Private Cloud User Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSMutableArray *securityGroups</Declaration>

			<Anchor>//api/name/securityGroups</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setUserData:</TokenIdentifier>
			<Abstract type="html">The user data to make available to the launched Amazon EC2 instances.
For more information about Amazon EC2 user data, see User
Data Retrieval in the Amazon Elastic Compute Cloud User
Guide.

Constraints:

Length: 0 - 21847

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *userData</Declaration>

			<Anchor>//api/name/userData</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/userData</TokenIdentifier>
			<Abstract type="html">The user data to make available to the launched Amazon EC2 instances.
For more information about Amazon EC2 user data, see User
Data Retrieval in the Amazon Elastic Compute Cloud User
Guide.

Constraints:

Length: 0 - 21847

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *userData</Declaration>

			<Anchor>//api/name/userData</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/userData</TokenIdentifier>
			<Abstract type="html">The user data to make available to the launched Amazon EC2 instances.
For more information about Amazon EC2 user data, see User
Data Retrieval in the Amazon Elastic Compute Cloud User
Guide.

Constraints:

Length: 0 - 21847

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *userData</Declaration>

			<Anchor>//api/name/userData</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setInstanceType:</TokenIdentifier>
			<Abstract type="html">The instance type of the Amazon EC2 instance. For information about
available Amazon EC2 instance types, see
Available Instance Types in the Amazon Elastic Cloud Compute
User Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *instanceType</Declaration>

			<Anchor>//api/name/instanceType</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/instanceType</TokenIdentifier>
			<Abstract type="html">The instance type of the Amazon EC2 instance. For information about
available Amazon EC2 instance types, see
Available Instance Types in the Amazon Elastic Cloud Compute
User Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *instanceType</Declaration>

			<Anchor>//api/name/instanceType</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/instanceType</TokenIdentifier>
			<Abstract type="html">The instance type of the Amazon EC2 instance. For information about
available Amazon EC2 instance types, see
Available Instance Types in the Amazon Elastic Cloud Compute
User Guide.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *instanceType</Declaration>

			<Anchor>//api/name/instanceType</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setKernelId:</TokenIdentifier>
			<Abstract type="html">The ID of the kernel associated with the Amazon EC2 AMI.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *kernelId</Declaration>

			<Anchor>//api/name/kernelId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/kernelId</TokenIdentifier>
			<Abstract type="html">The ID of the kernel associated with the Amazon EC2 AMI.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *kernelId</Declaration>

			<Anchor>//api/name/kernelId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/kernelId</TokenIdentifier>
			<Abstract type="html">The ID of the kernel associated with the Amazon EC2 AMI.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *kernelId</Declaration>

			<Anchor>//api/name/kernelId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setRamdiskId:</TokenIdentifier>
			<Abstract type="html">The ID of the RAM disk associated with the Amazon EC2 AMI.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *ramdiskId</Declaration>

			<Anchor>//api/name/ramdiskId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/ramdiskId</TokenIdentifier>
			<Abstract type="html">The ID of the RAM disk associated with the Amazon EC2 AMI.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *ramdiskId</Declaration>

			<Anchor>//api/name/ramdiskId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/ramdiskId</TokenIdentifier>
			<Abstract type="html">The ID of the RAM disk associated with the Amazon EC2 AMI.

Constraints:

Length: 1 - 255

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *ramdiskId</Declaration>

			<Anchor>//api/name/ramdiskId</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setBlockDeviceMappings:</TokenIdentifier>
			<Abstract type="html">A list of mappings that specify how block devices are exposed to the
instance. Each mapping is made up of a VirtualName, a
DeviceName, and an ebs data structure that contains
information about the associated Elastic Block Storage volume. For
more information about Amazon EC2 BlockDeviceMappings, go to
Block Device Mapping in the Amazon EC2 product documentation.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSMutableArray *blockDeviceMappings</Declaration>

			<Anchor>//api/name/blockDeviceMappings</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/blockDeviceMappings</TokenIdentifier>
			<Abstract type="html">A list of mappings that specify how block devices are exposed to the
instance. Each mapping is made up of a VirtualName, a
DeviceName, and an ebs data structure that contains
information about the associated Elastic Block Storage volume. For
more information about Amazon EC2 BlockDeviceMappings, go to
Block Device Mapping in the Amazon EC2 product documentation.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSMutableArray *blockDeviceMappings</Declaration>

			<Anchor>//api/name/blockDeviceMappings</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/blockDeviceMappings</TokenIdentifier>
			<Abstract type="html">A list of mappings that specify how block devices are exposed to the
instance. Each mapping is made up of a VirtualName, a
DeviceName, and an ebs data structure that contains
information about the associated Elastic Block Storage volume. For
more information about Amazon EC2 BlockDeviceMappings, go to
Block Device Mapping in the Amazon EC2 product documentation.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSMutableArray *blockDeviceMappings</Declaration>

			<Anchor>//api/name/blockDeviceMappings</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setInstanceMonitoring:</TokenIdentifier>
			<Abstract type="html">Enables detailed monitoring if it is disabled. Detailed monitoring is
enabled by default.
 When detailed monitoring is enabled, Amazon
Cloudwatch will generate metrics every minute and your account will be
charged a fee. When you disable detailed monitoring, by specifying
False, Cloudwatch will generate metrics every 5 minutes.
For more information, see Monitor
Your Auto Scaling Instances. For information about Amazon
CloudWatch, see the Amazon
CloudWatch Developer Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) AutoScalingInstanceMonitoring *instanceMonitoring</Declaration>

			<Anchor>//api/name/instanceMonitoring</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/instanceMonitoring</TokenIdentifier>
			<Abstract type="html">Enables detailed monitoring if it is disabled. Detailed monitoring is
enabled by default.
 When detailed monitoring is enabled, Amazon
Cloudwatch will generate metrics every minute and your account will be
charged a fee. When you disable detailed monitoring, by specifying
False, Cloudwatch will generate metrics every 5 minutes.
For more information, see Monitor
Your Auto Scaling Instances. For information about Amazon
CloudWatch, see the Amazon
CloudWatch Developer Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) AutoScalingInstanceMonitoring *instanceMonitoring</Declaration>

			<Anchor>//api/name/instanceMonitoring</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/instanceMonitoring</TokenIdentifier>
			<Abstract type="html">Enables detailed monitoring if it is disabled. Detailed monitoring is
enabled by default.
 When detailed monitoring is enabled, Amazon
Cloudwatch will generate metrics every minute and your account will be
charged a fee. When you disable detailed monitoring, by specifying
False, Cloudwatch will generate metrics every 5 minutes.
For more information, see Monitor
Your Auto Scaling Instances. For information about Amazon
CloudWatch, see the Amazon
CloudWatch Developer Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) AutoScalingInstanceMonitoring *instanceMonitoring</Declaration>

			<Anchor>//api/name/instanceMonitoring</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setSpotPrice:</TokenIdentifier>
			<Abstract type="html">The maximum hourly price to be paid for any Spot Instance launched to
fulfill the request. Spot Instances are launched when the price you
specify exceeds the current Spot market price. For more information on
launching Spot Instances, see
Using Auto Scaling to Launch Spot Instances in the Auto Scaling
Developer Guide.

Constraints:

Length: 1 - 255
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *spotPrice</Declaration>

			<Anchor>//api/name/spotPrice</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/spotPrice</TokenIdentifier>
			<Abstract type="html">The maximum hourly price to be paid for any Spot Instance launched to
fulfill the request. Spot Instances are launched when the price you
specify exceeds the current Spot market price. For more information on
launching Spot Instances, see
Using Auto Scaling to Launch Spot Instances in the Auto Scaling
Developer Guide.

Constraints:

Length: 1 - 255
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *spotPrice</Declaration>

			<Anchor>//api/name/spotPrice</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/spotPrice</TokenIdentifier>
			<Abstract type="html">The maximum hourly price to be paid for any Spot Instance launched to
fulfill the request. Spot Instances are launched when the price you
specify exceeds the current Spot market price. For more information on
launching Spot Instances, see
Using Auto Scaling to Launch Spot Instances in the Auto Scaling
Developer Guide.

Constraints:

Length: 1 - 255
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *spotPrice</Declaration>

			<Anchor>//api/name/spotPrice</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setIamInstanceProfile:</TokenIdentifier>
			<Abstract type="html">The name or the Amazon Resource Name (ARN) of the instance profile
associated with the IAM role for the instance.
Amazon EC2 instances
launched with an IAM role will automatically have AWS security
credentials available. You can use IAM roles with Auto Scaling to
automatically enable applications running on your Amazon EC2 instances
to securely access other AWS resources. For information on launching
EC2 instances with an IAM role, go to Launching
Auto Scaling Instances With an IAM Role in the Auto Scaling
Developer Guide.

Constraints:

Length: 1 - 1600

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *iamInstanceProfile</Declaration>

			<Anchor>//api/name/iamInstanceProfile</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/iamInstanceProfile</TokenIdentifier>
			<Abstract type="html">The name or the Amazon Resource Name (ARN) of the instance profile
associated with the IAM role for the instance.
Amazon EC2 instances
launched with an IAM role will automatically have AWS security
credentials available. You can use IAM roles with Auto Scaling to
automatically enable applications running on your Amazon EC2 instances
to securely access other AWS resources. For information on launching
EC2 instances with an IAM role, go to Launching
Auto Scaling Instances With an IAM Role in the Auto Scaling
Developer Guide.

Constraints:

Length: 1 - 1600

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *iamInstanceProfile</Declaration>

			<Anchor>//api/name/iamInstanceProfile</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/iamInstanceProfile</TokenIdentifier>
			<Abstract type="html">The name or the Amazon Resource Name (ARN) of the instance profile
associated with the IAM role for the instance.
Amazon EC2 instances
launched with an IAM role will automatically have AWS security
credentials available. You can use IAM roles with Auto Scaling to
automatically enable applications running on your Amazon EC2 instances
to securely access other AWS resources. For information on launching
EC2 instances with an IAM role, go to Launching
Auto Scaling Instances With an IAM Role in the Auto Scaling
Developer Guide.

Constraints:

Length: 1 - 1600

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic, retain) NSString *iamInstanceProfile</Declaration>

			<Anchor>//api/name/iamInstanceProfile</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setEbsOptimized:</TokenIdentifier>
			<Abstract type="html">Whether the instance is optimized for EBS I/O. The optimization
provides dedicated throughput to Amazon EBS and an optimized
configuration stack to provide optimal EBS I/O performance. This
optimization is not available with all instance types. Additional
usage charges apply when using an EBS Optimized instance. By default
the instance is not optimized for EBS I/O. For information about
EBS-optimized instances, go to EBS-Optimized
Instances in the Amazon Elastic Compute Cloud User Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic) BOOL ebsOptimized</Declaration>

			<Anchor>//api/name/ebsOptimized</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/ebsOptimized</TokenIdentifier>
			<Abstract type="html">Whether the instance is optimized for EBS I/O. The optimization
provides dedicated throughput to Amazon EBS and an optimized
configuration stack to provide optimal EBS I/O performance. This
optimization is not available with all instance types. Additional
usage charges apply when using an EBS Optimized instance. By default
the instance is not optimized for EBS I/O. For information about
EBS-optimized instances, go to EBS-Optimized
Instances in the Amazon Elastic Compute Cloud User Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic) BOOL ebsOptimized</Declaration>

			<Anchor>//api/name/ebsOptimized</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/ebsOptimized</TokenIdentifier>
			<Abstract type="html">Whether the instance is optimized for EBS I/O. The optimization
provides dedicated throughput to Amazon EBS and an optimized
configuration stack to provide optimal EBS I/O performance. This
optimization is not available with all instance types. Additional
usage charges apply when using an EBS Optimized instance. By default
the instance is not optimized for EBS I/O. For information about
EBS-optimized instances, go to EBS-Optimized
Instances in the Amazon Elastic Compute Cloud User Guide.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic) BOOL ebsOptimized</Declaration>

			<Anchor>//api/name/ebsOptimized</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/setAssociatePublicIpAddress:</TokenIdentifier>
			<Abstract type="html">Used for Auto Scaling groups that launch instances into an Amazon
Virtual Private Cloud (Amazon VPC). Specifies whether to assign a
public IP address to each instance launched in a Amazon VPC. <note>

If you specify a value for this parameter, be sure to specify at
least one VPC subnet using the VPCZoneIdentifier parameter when
you create your Auto Scaling group. </note>
Default: If the
instance is launched in default VPC, the default is true.
If the instance is launched in a nondefault VPC (EC2-VPC), the default
is false. For more information about the platforms
supported by Auto Scaling, see Basic
Auto Scaling Configuration.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic) BOOL associatePublicIpAddress</Declaration>

			<Anchor>//api/name/associatePublicIpAddress</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/associatePublicIpAddress</TokenIdentifier>
			<Abstract type="html">Used for Auto Scaling groups that launch instances into an Amazon
Virtual Private Cloud (Amazon VPC). Specifies whether to assign a
public IP address to each instance launched in a Amazon VPC. <note>

If you specify a value for this parameter, be sure to specify at
least one VPC subnet using the VPCZoneIdentifier parameter when
you create your Auto Scaling group. </note>
Default: If the
instance is launched in default VPC, the default is true.
If the instance is launched in a nondefault VPC (EC2-VPC), the default
is false. For more information about the platforms
supported by Auto Scaling, see Basic
Auto Scaling Configuration.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic) BOOL associatePublicIpAddress</Declaration>

			<Anchor>//api/name/associatePublicIpAddress</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instp/AutoScalingCreateLaunchConfigurationRequest/associatePublicIpAddress</TokenIdentifier>
			<Abstract type="html">Used for Auto Scaling groups that launch instances into an Amazon
Virtual Private Cloud (Amazon VPC). Specifies whether to assign a
public IP address to each instance launched in a Amazon VPC. <note>

If you specify a value for this parameter, be sure to specify at
least one VPC subnet using the VPCZoneIdentifier parameter when
you create your Auto Scaling group. </note>
Default: If the
instance is launched in default VPC, the default is true.
If the instance is launched in a nondefault VPC (EC2-VPC), the default
is false. For more information about the platforms
supported by Auto Scaling, see Basic
Auto Scaling Configuration.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>@property (nonatomic) BOOL associatePublicIpAddress</Declaration>

			<Anchor>//api/name/associatePublicIpAddress</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/addSecurityGroup:</TokenIdentifier>
			<Abstract type="html">Adds a single object to securityGroups.
This function will alloc and init securityGroups if not already done.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>- (void)addSecurityGroup:(NSString *)securityGroupObject</Declaration>

			<Anchor>//api/name/addSecurityGroup:</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/addBlockDeviceMapping:</TokenIdentifier>
			<Abstract type="html">Adds a single object to blockDeviceMappings.
This function will alloc and init blockDeviceMappings if not already done.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>- (void)addBlockDeviceMapping:(AutoScalingBlockDeviceMapping *)blockDeviceMappingObject</Declaration>

			<Anchor>//api/name/addBlockDeviceMapping:</Anchor>
            <NodeRef refid="37"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/AutoScalingCreateLaunchConfigurationRequest/description</TokenIdentifier>
			<Abstract type="html">Returns a string representation of this object; useful for testing and
debugging.</Abstract>
			<DeclaredIn>AutoScalingCreateLaunchConfigurationRequest.h</DeclaredIn>

			<Declaration>- (NSString *)description</Declaration>

			<ReturnValue><Abstract type="html">A string representation of this object.</Abstract></ReturnValue>
			<Anchor>//api/name/description</Anchor>
            <NodeRef refid="37"/>
		</Token>

	</File>
</Tokens>


text:
<!DOCTYPE html>
<html>

	{% include head.html %}

	<body>

		{% include header.html %}

		<section class="container">
			{{ content }}
		</section>

		{% include footer.html %}

		{% include scripts.html %}
		{% include search.html %}
		{% include headerLink.html %}

		{% include fonts.html %}
		{% include yandexMetrika.html %}
		{% include googleAnalytics.html %}

	</body>

</html>

redpajama_set_name: RedPajamaGithub


text:
"""
FMS custom exceptions classes
"""
import logging

class MissingParameter(Exception):
    """
    Custom exception class for missing parameter in
    simulation config file.
    """
    def __init__(self, msg):
        logger = logging.getLogger("fms.utils.exceptions")
        logger.exception("Missing parameter: %s" % msg)
        self.msg = msg

    def __str__(self):
        return self.msg

class NotAnInteger(Exception):
    """
    Custom exception class: value should be an integer.
    """
    def __init__(self, value):
        logger = logging.getLogger("fms.utils.exceptions")
        logger.exception("Not an integer: %s" % value)
        self.value = value

    def __str__(self):
        return self.value


text:
.. _json-packages:

=============
JSON Packages
=============

When you design a new module for Wiggleport, you supply additional JSON files that load into the hardware model when your add-on is detected.

.. _package-metadata:

Package Metadata
================

.. _class-attachment:

Class Attachment
================

.. _io-drivers:

I/O Drivers
===========


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:padding="3dp">

    <ImageView
        android:id="@+id/tweetPhotoImageView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:contentDescription="@string/tweet_photo_contentDescriptor"
        android:scaleType="centerCrop" />

    <ImageButton
        android:id="@+id/deleteButton"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_margin="7dp"
        android:background="?circleDrawable"
        android:contentDescription="@string/delete_photo_tweet_contentDescriptor"
        android:src="@drawable/ic_delete" />

</RelativeLayout>


text:
var express = require('express');
var router = express.Router();
var filter = require('../passport.js');
var Textcom = require('../../db/textcom');

router.post('/', function (req, res, next) {
    filter.authorize(req, res, function (req, res) {
        var textcomId = req.body.textcomId;
        Textcom.deleteTextcom(textcomId,function (err, textcomEntity) {
            if (err) {
                res.status('500');
                res.send({
                    success: false, // 标记失败
                    model: {
                        error: '系统错误'
                    }
                });
            } else {
                res.status('200');
                res.send({
                    success: true,
                    model: {
                        _id: textcomId
                    }
                });
            }
        });
    });
});

module.exports = router;


text:
shared_examples_for 'client' do
  describe :mkdir_p do
    before do
      base = @base_path.sub(%r_^/_, '')

      @path_ary = %W[#{base} test mkdir_p path creation]
      @bogus_path = File.join('', *@path_ary)
    end

    it %[should create all intermediate paths for the path givem] do
      expect(@zk.exists?(@bogus_path)).to be(false)
      expect(@zk.exists?(File.dirname(@bogus_path))).to be(false)
      @zk.mkdir_p(@bogus_path)
      expect(@zk.exists?(@bogus_path)).to be(true)
    end

    it %[should place the data only at the leaf node] do
      @zk.mkdir_p(@bogus_path, :data => 'foobar')
      expect(@zk.get(@bogus_path).first).to eq('foobar')

      path = ''
      @path_ary[0..-2].each do |el|
        path = File.join(path, el)
        expect(@zk.get(path).first).to eq('')
      end
    end

    it %[should replace the data at the leaf node if it already exists] do
      @zk.mkdir_p(@bogus_path, :data => 'blahfoo')
      @zk.mkdir_p(@bogus_path, :data => 'foodink')
      expect(@zk.get(@bogus_path).first).to eq('foodink')
    end
  end

  # nail down all possible cases
  describe :create do
    describe 'only path given' do
      it %[should create a node with blank data] do
        @zk.create(@base_path)
        expect(@zk.get(@base_path).first).to eq('')
      end
    end

    describe 'path and data given' do
      it %[should create a node with the path and data] do
        @zk.create(@base_path, 'blah')
        expect(@zk.get(@base_path).first).to eq('blah')
      end
    end

    describe 'path and sequential' do
      it %[should create a sequential node with blank data] do
        @zk.create(@base_path)
        path = @zk.create("#{@base_path}/v", :sequential => true)
        expect(path.start_with?(@base_path)).to be(true)

        expect(File.basename(path)).to match(/v\d+/)

        expect(@zk.get(path).first).to eq('')
      end

      it %[should create a sequential node with given data] do
        @zk.create(@base_path)
        path = @zk.create("#{@base_path}/v", 'thedata', :sequential => true)
        expect(path.start_with?(@base_path)).to be(true)

        expect(File.basename(path)).to match(/v\d+/)

        data, st = @zk.get(path)
        expect(data).to eq('thedata')
        expect(st).not_to be_ephemeral
      end
    end

    describe 'path and ephemeral' do
      it %[should create an ephemeral node with blank data] do
        @zk.create(@base_path, :ephemeral => true)
        expect(@zk.get(@base_path).last).to be_ephemeral
      end

      it %[should create an ephemeral node with given data] do
        @zk.create(@base_path, 'thedata', :ephemeral => true)
        data, stat = @zk.get(@base_path)
        expect(data).to eq('thedata')
        expect(stat).to be_ephemeral
      end
    end

    describe 'path and sequential and ephemeral' do
      it %[should create a sequential ephemeral node with blank data] do
        @zk.create(@base_path)
        path = @zk.create("#{@base_path}/v", :sequential => true, :ephemeral => true)
        expect(path.start_with?(@base_path)).to be(true)

        expect(File.basename(path)).to match(/v\d+/)

        data, st = @zk.get(path)
        expect(data).to eq('')
        expect(st).to be_ephemeral
      end

      it %[should create a sequential ephemeral node with given data] do
        @zk.create(@base_path)
        path = @zk.create("#{@base_path}/v", 'thedata', :sequential => true, :ephemeral => true)
        expect(path.start_with?(@base_path)).to be(true)

        expect(File.basename(path)).to match(/v\d+/)

        data, st = @zk.get(path)
        expect(data).to eq('thedata')
        expect(st).to be_ephemeral
      end
    end

    it %[should barf if someone hands 3 params] do
      expect { @zk.create(@base_path, 'data', :sequence) }.to raise_error(ArgumentError)
    end

    it %[should barf if both :sequence and :sequential are given] do
      expect { @zk.create(@base_path, 'data', :sequence => true, :sequential => true) }.to raise_error(ArgumentError)
    end

    describe %[:ignore option] do
      it %[should squelch node_exists] do
        @zk.create(@base_path)

        expect { expect(@zk.create(@base_path, :ignore => :node_exists)).to be_nil }.not_to raise_error
      end

      it %[should squelch no_node] do
        expect { expect(@zk.create("#{@base_path}/foo/bar/baz", :ignore => :no_node)).to be_nil }.not_to raise_error
      end
    end

    describe %[:or option] do
      let(:path) { "#{@base_path}/foo/bar" }

      it %[should barf if anything but the the :set value is given] do
        expect { @zk.create(path, :or => :GFY) }.to raise_error(ArgumentError)
      end

      def create_args(opts={})
        proc do
          begin
            @zk.create(path, opts.merge(:or => :set))
          ensure
            @zk.rm_rf(path)
          end
        end
      end

      it %[should barf if any node option besides 'persistent' is given] do
        expect(create_args(:persistent => true)).not_to         raise_error
        expect(create_args(:sequential => true)).to             raise_error(ArgumentError)
        expect(create_args(:mode => :ephemeral)).to             raise_error(ArgumentError)
        expect(create_args(:mode => :ephemeral_sequential)).to  raise_error(ArgumentError)
        expect(create_args(:mode => :sequential)).to            raise_error(ArgumentError)
      end

      it %[should replace the data at the leaf node if it already exists] do
        @zk.mkdir_p(path, :data => 'foodink')
        @zk.create(path, 'blahfoo', :or => :set)
        expect(@zk.get(path).first).to eq('blahfoo')
      end

      it %[should create the intermediate paths] do
        expect { @zk.create(path, 'foobar', :or => :set) }.not_to raise_error

        expect(@zk.stat(@base_path)).to exist
        expect(@zk.stat("#{@base_path}/foo")).to exist
      end
    end
  end

  describe :delete do
    describe %[:ignore option] do
      it %[should squelch not_empty] do
        @zk.create(@base_path)
        @zk.create("#{@base_path}/blah")

        expect { expect(@zk.delete(@base_path, :ignore => :not_empty)).to be_nil }.not_to raise_error
      end

      it %[should squelch no_node] do
        expect { expect(@zk.delete("#{@base_path}/foo/bar/baz", :ignore => :no_node)).to be_nil }.not_to raise_error
      end

      it %[should squelch bad_version] do
        @zk.create(@base_path)
        expect { expect(@zk.delete("#{@base_path}", :version => 7, :ignore => :bad_version)).to be_nil }.not_to raise_error
      end
    end
  end

  describe :stat do
    describe 'for a missing node' do
      before do
        @missing_path = '/thispathdoesnotexist'
        begin
          @zk.delete(@missing_path)
        rescue ZK::Exceptions::NoNode
        end
      end

      it %[should not raise any error] do
        expect { @zk.stat(@missing_path) }.not_to raise_error
      end

      it %[should return a Stat object] do
        expect(@zk.stat(@missing_path)).to be_kind_of(Zookeeper::Stat)
      end

      it %[should return a stat that not exists?] do
        expect(@zk.stat(@missing_path)).not_to be_exists
      end
    end
  end

  describe :set do
    describe %[:ignore option] do
      it %[should squelch no_node] do
        expect { expect(@zk.set("#{@base_path}/foo/bar/baz", '', :ignore => :no_node)).to be_nil }.not_to raise_error
      end

      it %[should squelch bad_version] do
        @zk.create(@base_path)
        expect { expect(@zk.set("#{@base_path}", '', :version => 7, :ignore => :bad_version)).to be_nil }.not_to raise_error
      end
    end
  end

  describe :block_until_node_deleted do
    before do
      @path = '/_bogualkjdhsna'
    end

    describe 'no node initially' do
      before do
        expect(@zk.exists?(@path)).to be(false)
      end

      it %[should not block] do
        @a = false

        th = Thread.new do
          @zk.block_until_node_deleted(@path)
          @a = true
        end

        th.join(2)
        expect(@a).to be(true)
      end
    end

    describe 'node exists initially' do
      before do
        @zk.create(@path, :mode => :ephemeral)
        expect(@zk.exists?(@path)).to be(true)
      end

      it %[should block until the node is deleted] do
        @a = false

        Thread.new do
          @zk.block_until_node_deleted(@path)
          @a = true
        end

        Thread.pass
        expect(@a).to be(false)

        @zk.delete(@path)

        wait_until(2) { @a }
        expect(@a).to be(true)
      end
    end
  end

  describe 'session_id and session_passwd' do
    it %[should expose the underlying session_id] do
      expect(@zk.session_id).to be_kind_of(Integer)
    end

    it %[should expose the underlying session_passwd] do
      expect(@zk.session_passwd).to be_kind_of(String)
    end
  end

  describe 'reopen' do
    describe 'watchers' do
      before do
        @path = '/testwatchers'
        @queue = Queue.new
        @zk.delete(@path) rescue ZK::Exceptions::NoNode
      end

#       after do
#         logger.info { "AFTER EACH" }
#         @zk.delete(@path)
#       end

      def ensure_event_delivery!
        @sub ||= @zk.event_handler.register(@path) do |event|
          logger.debug { "got event: #{event.inspect}" }
          @queue << event
        end

        expect(@zk.exists?(@path, :watch => true)).to be(false)
        @zk.create(@path)

        logger.debug { "waiting for event delivery" }

        wait_until(2) do
          begin
            event = @queue.pop(true)
            logger.debug { "got event: #{event}" }
            @events << event
            true
          rescue ThreadError
            false
          end
        end

        # first watch delivered correctly
        expect(@events.length).to be > 0
      end

      it %[should fire re-registered watchers after reopen (#9)] do
        @events = []

        logger.debug { "ensure event delivery" }
        ensure_event_delivery!

        logger.debug { "reopening connection" }
        @zk.reopen

        wait_until(2) { @zk.connected? }

        logger.debug { "deleting path" }
        @zk.delete(@path)

        logger.debug { "clearing events" }
        @events.clear

        logger.debug  { "taunt them a second time" }
        ensure_event_delivery!

        logger.debug { "events: #{@events.inspect}" }
      end
    end

  end # reopen

  describe 'reconnection' do
    it %[should if it receives a client_invalid? event] do
      # note: we can't trust the events to be delivered in any particular order
      # since they're happening on two different threads. if we see we're connected
      # in the beginning, that there was a disconnection, then a reopen, that's
      # probably fine.
      #
      # we also check that the session_id was changed, which is the desired effect

      orig_session_id = @zk.session_id
      expect(@zk).to be_connected

      props = {
        :session_event?   => true,
        :node_event?      => false,
        :client_invalid?  => true,
        :state_name       => 'ZOO_EXPIRED_SESSION_STATE',
        :state            => Zookeeper::ZOO_EXPIRED_SESSION_STATE,
      }

      bogus_event = instance_double(Zookeeper::Callbacks::WatcherCallback, props)
      expect(bogus_event).to receive(:zk=).with(@zk).once

      mutex = Monitor.new
      cond  = mutex.new_cond
      events = []

      @sub = @zk.on_state_change do |event|
        mutex.synchronize do
          logger.debug { "event: #{event.inspect}" }
          events << event.state
          cond.broadcast
        end
      end

      mutex.synchronize do
        expect(events).to be_empty
        @zk.event_handler.process(bogus_event)
      end

      logger.debug { "events: #{events.inspect}" }

      mutex.synchronize do
        time_to_stop = Time.now + 2
        cond.wait_while { (events.length < 2 ) && (Time.now < time_to_stop) }
      end

      expect(events).to include(Zookeeper::ZOO_EXPIRED_SESSION_STATE)
      expect(events).to include(Zookeeper::ZOO_CONNECTED_STATE)
      expect(@zk.session_id).not_to eq(orig_session_id)
    end
  end # reconnection

  describe :on_exception do
    it %[should register a callback that will be called if an exception is raised on the threadpool] do
      @ary = []

      @zk.on_exception { |exc| @ary << exc }

      @zk.defer { raise "ZOMG!" }

      wait_while(2) { @ary.empty? }

      expect(@ary.length).to eq(1)

      e = @ary.shift

      expect(e).to be_kind_of(RuntimeError)
      expect(e.message).to eq('ZOMG!')
    end
  end

  describe :on_threadpool? do
    it %[should be true if we're on the threadpool] do
      @ary = []

      @zk.defer { @ary << @zk.on_threadpool? }

      wait_while(2) { @ary.empty? }
      expect(@ary.length).to eq(1)
      expect(@ary.first).to be(true)
    end
  end
end


text:
describe('expect.js', function () {
  'use strict';

  var expect = require('expect.js');

  it('simple test for assertion library', function () {
    expect(true).to.be(true);
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="urn:metadata.tooling.soap.sforce.com" fqn="MB_VoiceMessage">
    <apiVersion>40.0</apiVersion>
    <status>Active</status>
</ApexClass>


text:
package org.azolla.l.ling.ftp;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.util.Arrays;
import java.util.List;

import javax.annotation.Nullable;

import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPFileFilter;
import org.apache.commons.net.ftp.FTPReply;
import org.azolla.l.ling.exception.AzollaException;
import org.azolla.l.ling.exception.code.AzollaCode;
import org.azolla.l.ling.io.Close0;
import org.azolla.l.ling.io.Encoding0;
import org.azolla.l.ling.io.File0;
import org.azolla.l.ling.lang.String0;
import org.azolla.l.ling.text.Fmt0;
import org.azolla.l.ling.util.KV;
import org.azolla.l.ling.util.Log0;

import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;

/**
 * Ftp0
 *
 * via http://blog.csdn.net/cuiran/article/details/7186621
 *
 * @author 	sk@azolla.org
 * @since 	ADK1.0
 */
public final class Ftp0
{
    public static final int     DEFAULT_PORT        = 21;
    public static final int     DEFAULT_FILE_TYPE   = FTPClient.BINARY_FILE_TYPE;
    public static final int     DEFAULT_MODE        = FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE;
    public static final int     DEFAULT_TIMEOUT     = 3000;
    public static final int     DEFAULT_BUFFER_SIZE = 100000;

    private static Ftp0         instance            = null;

    private String              host;
    private String              username;
    private String              password;

    private int                 port                = DEFAULT_PORT;
    private int                 fileType            = DEFAULT_FILE_TYPE;
    private int                 mode                = DEFAULT_MODE;
    private int                 timeout             = DEFAULT_TIMEOUT;
    private int                 bufferSize          = DEFAULT_BUFFER_SIZE;

    private String              encoding            = Encoding0.UTF_8;

    private FTPClient           client;

    public static synchronized Ftp0 single(String host, String username, String password)
    {
        return single(host, username, password, DEFAULT_PORT);
    }

    public static synchronized Ftp0 single(String host, String username, String password, int port)
    {
        return single(host, username, password, port, DEFAULT_FILE_TYPE);
    }

    public static synchronized Ftp0 single(String host, String username, String password, int port, int fileType)
    {
        return single(host, username, password, port, fileType, DEFAULT_MODE);
    }

    public static synchronized Ftp0 single(String host, String username, String password, int port, int fileType, int mode)
    {
        return single(host, username, password, port, fileType, mode, DEFAULT_TIMEOUT);
    }

    public static synchronized Ftp0 single(String host, String username, String password, int port, int fileType, int mode, int timeout)
    {
        return single(host, username, password, port, fileType, mode, timeout, Encoding0.UTF_8);
    }

    public static synchronized Ftp0 single(String host, String username, String password, int port, int fileType, int mode, int timeout, String encoding)
    {
        return instance == null ? new Ftp0(host, username, password, port, fileType, mode, timeout, encoding) : instance;
    }

    public Ftp0(String host, String username, String password)
    {
        this(host, username, password, DEFAULT_PORT);
    }

    public Ftp0(String host, String username, String password, int port)
    {
        this(host, username, password, port, DEFAULT_FILE_TYPE);
    }

    public Ftp0(String host, String username, String password, int port, int fileType)
    {
        this(host, username, password, port, fileType, DEFAULT_MODE);
    }

    public Ftp0(String host, String username, String password, int port, int fileType, int mode)
    {
        this(host, username, password, port, fileType, mode, DEFAULT_TIMEOUT);
    }

    public Ftp0(String host, String username, String password, int port, int fileType, int mode, int timeout)
    {
        this(host, username, password, port, fileType, mode, timeout, Encoding0.UTF_8);
    }

    public Ftp0(String host, String username, String password, int port, int fileType, int mode, int timeout, String encoding)
    {
        connect(host, username, password, port, fileType, mode, timeout, encoding);
    }

    private FTPClient activeClient()
    {
        disconnect();
        connect(host, username, password, port, fileType, mode, timeout, encoding);
        return client;
    }

    private void connect(String host, String username, String password, int port, int fileType, int mode, int timeout, @Nullable String encoding)
    {
        client = new FTPClient();

        //0.encoding
        setEncoding(encoding);

        //1.connect
        try
        {
            client.connect(host, port);

            setHost(host);
            setPort(port);
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_CONNECT_ERROR, KV.ins("host", host).put("port", port), e);
            throw AzollaException.wrap(e, AzollaCode.FTP_CONNECT_ERROR).set("host", host).set("port", port);
        }

        int code = client.getReplyCode();	//get return code after connect
        if(FTPReply.isPositiveCompletion(code))
        {
            //2.login
            boolean logined = true;
            try
            {
                logined = client.login(username, password);	//test username and password
            }
            catch(Exception e)
            {
                Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_LOGIN_ERROR, KV.ins("username", username).put("password", password), e);
                throw AzollaException.wrap(e, AzollaCode.FTP_LOGIN_ERROR).set("username", username).set("password", password);
            }

            if(logined)
            {
                setUsername(username);
                setPassword(password);

                setFileType(fileType);
                setBufferSize(bufferSize);
            }
            else
            {
                Log0.error(this.getClass(), Fmt0.LOG_EC_P, AzollaCode.FTP_LOGIN_FAILED, KV.ins("username", username).put("password", password));
                throw new AzollaException(AzollaCode.FTP_LOGIN_FAILED).set("username", username).set("password", password);
            }
        }
        else
        {
            disconnect();
        }

        //3.mode
        setMode(mode);

        //4.fileType
        setFileType(fileType);

        //5.timeout
        setTimeout(timeout);
    }

    public boolean disconnect()
    {
        boolean rtnBoolean = true;

        if(client != null && client.isConnected())
        {
            try
            {
                client.logout();
            }
            catch(Exception e)
            {
                Log0.warn(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_LOGOUT_ERROR, KV.ins("host", host), e);
                rtnBoolean = false;
            }
        }

        if(client != null && client.isConnected())
        {
            try
            {
                client.disconnect();
            }
            catch(Exception e)
            {
                Log0.warn(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_DISCONNECT_ERROR, KV.ins("host", host), e);
                rtnBoolean = false;
            }
        }

        return rtnBoolean;
    }

    //Delete file(document or directory) from ftp
    public boolean deleteFile(@Nullable FTPClient client, String remotePath)
    {
        boolean rtnBoolean = true;

        try
        {
            //If remotePath is null or empty will be very dangerous
            Preconditions.checkArgument(!Strings.isNullOrEmpty(remotePath));

            client = client == null ? activeClient() : client;

            if(isDirectory(client, remotePath))
            {
                rtnBoolean = deleteFile0(client, remotePath);
            }
            else
            {
                rtnBoolean = client.deleteFile(remotePath);
            }
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_DELETE_FILE_ERROR, KV.ins("remotePath", remotePath), e);
            rtnBoolean = false;
        }

        return rtnBoolean;
    }

    private boolean deleteFile0(FTPClient client, String remotePath)
    {
        boolean rtnBoolean = true;

        try
        {
            for(FTPFile file : client.listFiles(remotePath))
            {
                String prefix = remotePath + (remotePath.endsWith(String0.SLASH) ? String0.EMPTY : String0.SLASH);
                if(file.isDirectory())
                {
                    rtnBoolean = rtnBoolean && deleteFile0(client, prefix + file.getName());
                }
                rtnBoolean = rtnBoolean && client.deleteFile(prefix + file.getName());
            }
            rtnBoolean = rtnBoolean && client.deleteFile(remotePath);
        }
        catch(IOException e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_DELETE_FILE_ERROR, KV.ins("remotePath", remotePath), e);
            rtnBoolean = false;
        }

        return rtnBoolean;
    }

    //download file(document or directory) to local
    public boolean retrieveFile(@Nullable FTPClient client, String remotePath, File localFile)
    {
        boolean rtnBoolean = true;

        try
        {
            //If remotePath is null or empty will be very dangerous
            Preconditions.checkNotNull(localFile);
            Preconditions.checkArgument(!Strings.isNullOrEmpty(remotePath));

            client = client == null ? activeClient() : client;

            if((isDirectory(client, remotePath) && localFile.isDirectory()) || (!isDirectory(client, remotePath) && !localFile.isDirectory()))
            {
                //remote file(directory) to local file(directory)
                //remote file(document) to local file(document)
                rtnBoolean = retrieveFile0(client, remotePath, localFile);
            }
            else if(isExist(client, remotePath) && !isDirectory(client, remotePath) && localFile.isDirectory())
            {
                //remote file(document) to local file(directory)
                File file = File0.newFile(localFile, listFiles(client, remotePath, null).get(0).getName());
                rtnBoolean = file.createNewFile() && retrieveFile0(client, remotePath, file);
            }
            else
            {
                throw new IllegalArgumentException();
            }
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_RETRIEVE_FILE_ERROR, KV.ins("remotePath", remotePath).put("localFile", localFile), e);
            rtnBoolean = false;
        }

        return rtnBoolean;
    }

    //both directory or both document
    private boolean retrieveFile0(FTPClient client, String remotePath, File localFile)
    {
        boolean rtnBoolean = true;

        BufferedOutputStream bos = null;
        OutputStream os = null;
        try
        {
            if(isDirectory(client, remotePath) && localFile.isDirectory())
            {
                String prefix = remotePath + (remotePath.endsWith(String0.SLASH) ? String0.EMPTY : String0.SLASH);
                for(FTPFile file : client.listFiles(remotePath))
                {
                    String newPath = prefix + file.getName();
                    File newFile = File0.newFile(localFile, file.getName());
                    rtnBoolean = rtnBoolean && file.isDirectory() ? newFile.mkdirs() : newFile.createNewFile();
                    rtnBoolean = rtnBoolean && retrieveFile0(client, newPath, newFile);
                }
            }
            else
            {
                os = new FileOutputStream(localFile);
                bos = new BufferedOutputStream(os);
                rtnBoolean = rtnBoolean && client.retrieveFile(remotePath, bos);
            }

        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_RETRIEVE_FILE_ERROR, KV.ins("remotePath", remotePath).put("localFile", localFile), e);
            rtnBoolean = false;
        }
        finally
        {
            Close0.close(os);
            Close0.close(bos);
        }

        return rtnBoolean;
    }

    //file(document or directory) existed
    public boolean isExist(@Nullable FTPClient client, @Nullable String remotePath)
    {
        boolean rtnBoolean = false;

        try
        {

            client = client == null ? activeClient() : client;

            String[] pathArray = client.listNames(remotePath);
            if(pathArray != null && pathArray.length > 0)
            {
                rtnBoolean = true;
            }
            else
            {
                rtnBoolean = isDirectory0(client, remotePath);
            }
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_LIST_FILE_ERROR, KV.ins("remotePath", remotePath), e);
            rtnBoolean = false;
        }

        return rtnBoolean;
    }

    //file(directory) existed
    public boolean isDirectory(@Nullable FTPClient client, @Nullable String remotePath)
    {
        boolean rtnBoolean = false;

        try
        {
            client = client == null ? activeClient() : client;

            if(isExist(client, remotePath))
            {
                rtnBoolean = isDirectory0(client, remotePath);
            }
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_LIST_FILE_ERROR, KV.ins("remotePath", remotePath), e);
            rtnBoolean = false;
        }

        return rtnBoolean;
    }

    private boolean isDirectory0(FTPClient client, String remotePath)
    {
        boolean rtnBoolean = false;

        try
        {
            //1.empty root:String0.SLASH
            if(Strings.isNullOrEmpty(remotePath) && String0.SLASH.equalsIgnoreCase(remotePath))
            {
                rtnBoolean = true;
            }
            else
            {
                //2.empty folder:"/folder","/folder/","folder","folder/","folder/subfolder"
                remotePath = (remotePath.startsWith(String0.SLASH) ? String0.EMPTY : String0.SLASH) + remotePath;
                remotePath = remotePath + (remotePath.endsWith(String0.SLASH) ? String0.EMPTY : String0.SLASH);
                String[] nameArray = remotePath.split(String0.SLASH);
                FTPFile[] array = client.listFiles(String0.SLASH + Joiner.on(String0.SLASH).join(Arrays.copyOfRange(nameArray, 1, nameArray.length - 1)));
                if(array != null && array.length > 0)
                {
                    for(FTPFile file : array)
                    {
                        if(file.isDirectory() && file.getName().equals(nameArray[nameArray.length - 1]))
                        {
                            rtnBoolean = true;
                            break;
                        }
                    }
                }
            }
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_LIST_FILE_ERROR, KV.ins("remotePath", remotePath), e);
            rtnBoolean = false;
        }

        return rtnBoolean;
    }

    //List of fullpath under this folder, if remotePath is document return it
    public List<String> listNames(@Nullable FTPClient client, @Nullable String remotePath)
    {
        List<String> rtnList = Lists.newArrayList();

        try
        {
            client = client == null ? activeClient() : client;

            String[] pathArray = client.listNames(remotePath);
            rtnList = pathArray == null ? rtnList : Lists.newArrayList(pathArray);
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_LIST_FILE_ERROR, KV.ins("remotePath", remotePath), e);
        }

        return rtnList;
    }

    //All of fullpath under this folder, if remotePath is document return it
    public List<String> allNames(@Nullable FTPClient client, @Nullable String remotePath, @Nullable FTPFileFilter filter)
    {
        List<String> rtnList = Lists.newArrayList();

        try
        {
            client = client == null ? activeClient() : client;

            FTPFile[] pathArray = filter == null ? client.listFiles(remotePath) : client.listFiles(remotePath, filter);
            if(pathArray != null && pathArray.length > 0)
            {
                String filePrefix = Strings.isNullOrEmpty(remotePath) ? String0.EMPTY : (remotePath.startsWith(String0.SLASH) ? remotePath : String0.SLASH + remotePath);
                String folderPrefix = filePrefix.endsWith(String0.SLASH) ? filePrefix : filePrefix + String0.SLASH;
                for(FTPFile f : pathArray)
                {
                    if(f.isDirectory())
                    {
                        rtnList.addAll(allNames(client, folderPrefix + f.getName(), filter));
                    }
                    if(pathArray.length > 1)
                    {
                        rtnList.add(folderPrefix + f.getName());
                    }
                    else
                    {
                        int index = filePrefix.lastIndexOf(String0.SLASH);
                        rtnList.add(f.getName().equals(-1 == index ? filePrefix : filePrefix.substring(index + 1)) ? filePrefix : filePrefix + String0.SLASH + f.getName());
                    }
                }
            }
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_LIST_FILE_ERROR, KV.ins("remotePath", remotePath), e);
        }

        return rtnList;
    }

    //List of FTPFile under this folder, if remotePath is document return it
    public List<FTPFile> listFiles(@Nullable FTPClient client, @Nullable String remotePath, @Nullable FTPFileFilter filter)
    {
        List<FTPFile> rtnList = Lists.newArrayList();

        try
        {
            client = client == null ? activeClient() : client;

            FTPFile[] pathArray = filter == null ? client.listFiles(remotePath) : client.listFiles(remotePath, filter);
            rtnList = pathArray == null ? rtnList : Lists.newArrayList(pathArray);
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_LIST_FILE_ERROR, KV.ins("remotePath", remotePath), e);
        }

        return rtnList;
    }

    //upload file to ftp
    public boolean storeFile(@Nullable FTPClient client, String remotePath, File localFile)
    {
        boolean rtnBoolean = false;

        try
        {
            //If remotePath is null or empty will be very dangerous
            Preconditions.checkNotNull(localFile);
            Preconditions.checkArgument(!Strings.isNullOrEmpty(remotePath));

            client = client == null ? activeClient() : client;

            if((isDirectory(client, remotePath) && localFile.isDirectory()) || (!isDirectory(client, remotePath) && !localFile.isDirectory()))
            {
                rtnBoolean = storeFile0(client, remotePath, localFile);
            }
            else if(isDirectory(client, remotePath) && localFile.exists() && !localFile.isDirectory())
            {
                String prefix = remotePath + (remotePath.endsWith(String0.SLASH) ? String0.EMPTY : String0.SLASH);
                rtnBoolean = storeFile0(client, prefix + localFile.getName(), localFile);
            }
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_STORE_FILE_ERROR, KV.ins("remotePath", remotePath).put("localPath", localFile), e);
            rtnBoolean = false;
        }

        return rtnBoolean;
    }

    private boolean storeFile0(FTPClient client, String remotePath, File localFile)
    {
        boolean rtnBoolean = true;

        BufferedInputStream bis = null;
        InputStream is = null;
        try
        {
            if(isDirectory(client, remotePath) && localFile.isDirectory())
            {
                String prefix = remotePath + (remotePath.endsWith(String0.SLASH) ? String0.EMPTY : String0.SLASH);
                for(File newFile : localFile.listFiles())
                {
                    String newPath = prefix + newFile.getName();
                    rtnBoolean = rtnBoolean && newFile.isDirectory() ? client.makeDirectory(newPath) : true;
                    rtnBoolean = rtnBoolean && storeFile0(client, newPath, newFile);
                }
            }
            else
            {
                is = new FileInputStream(localFile);
                bis = new BufferedInputStream(is);
                rtnBoolean = rtnBoolean && client.storeFile(remotePath, bis);
            }

        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_RETRIEVE_FILE_ERROR, KV.ins("remotePath", remotePath).put("localFile", localFile), e);
            rtnBoolean = false;
        }
        finally
        {
            Close0.close(is);
            Close0.close(bis);
        }

        return rtnBoolean;
    }

    public String getHost()
    {
        return host;
    }

    public void setHost(String host)
    {
        this.host = host;
    }

    public String getUsername()
    {
        return username;
    }

    public void setUsername(String username)
    {
        this.username = username;
    }

    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public int getPort()
    {
        return port;
    }

    public void setPort(int port)
    {
        this.port = port;
    }

    public int getFileType()
    {
        return fileType;
    }

    public Ftp0 setFileType(int fileType)
    {
        try
        {
            client.setFileType(fileType);
            this.fileType = fileType;
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_SET_FILETYPE_ERROR, KV.ins("fileType", fileType), e);
            throw AzollaException.wrap(e, AzollaCode.FTP_SET_FILETYPE_ERROR).set("fileType", fileType);
        }
        return this;
    }

    public int getMode()
    {
        return mode;
    }

    public Ftp0 setMode(int mode)
    {
        boolean successed = true;
        switch(mode)
        {
            case FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE :
                client.enterLocalPassiveMode();
                break;
            case FTPClient.ACTIVE_LOCAL_DATA_CONNECTION_MODE :
                client.enterLocalActiveMode();
                break;
            case FTPClient.PASSIVE_REMOTE_DATA_CONNECTION_MODE :
                try
                {
                    successed = client.enterRemotePassiveMode();
                }
                catch(Exception e)
                {
                    successed = false;
                    Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_SET_MODE_ERROR, KV.ins("mode", mode), e);
                    throw AzollaException.wrap(e, AzollaCode.FTP_SET_MODE_ERROR).set("mode", mode);
                }
                break;
            case FTPClient.ACTIVE_REMOTE_DATA_CONNECTION_MODE :
                try
                {
                    successed = client.enterRemoteActiveMode(InetAddress.getByName(host), port);
                }
                catch(Exception e)
                {
                    successed = false;
                    Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_SET_MODE_ERROR, KV.ins("mode", mode), e);
                    throw AzollaException.wrap(e, AzollaCode.FTP_SET_MODE_ERROR).set("mode", mode);
                }
                break;
            default :
                throw new AzollaException(AzollaCode.FTP_SET_MODE_FAILED).set("mode", mode);
        }

        if(successed)
        {
            this.mode = mode;
        }
        return this;
    }

    public String getEncoding()
    {
        return encoding;
    }

    public Ftp0 setEncoding(@Nullable String encoding)
    {
        encoding = Strings.isNullOrEmpty(encoding) ? Encoding0.UTF_8 : encoding;

        client.setControlEncoding(encoding);
        this.encoding = encoding;
        return this;
    }

    public int getTimeout()
    {
        return timeout;
    }

    public Ftp0 setTimeout(int timeout)
    {
        try
        {
            client.setSoTimeout(timeout);
            this.timeout = timeout;
        }
        catch(Exception e)
        {
            Log0.error(this.getClass(), Fmt0.LOG_EC_P_M, AzollaCode.FTP_SET_TIMEOUT_ERROR, KV.ins("timeout", timeout), e);
            throw AzollaException.wrap(e, AzollaCode.FTP_SET_TIMEOUT_ERROR).set("timeout", timeout);
        }
        return this;
    }

    public FTPClient getClient()
    {
        return client;
    }

    public int getBufferSize()
    {
        return bufferSize;
    }

    public void setBufferSize(int bufferSize)
    {
        client.setBufferSize(bufferSize);
        this.bufferSize = bufferSize;
    }

}


text:
import networking_plumgrid
from networking_plumgrid._i18n import _
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
from neutron.api.v2 import base
from neutron import manager
from neutron_lib import exceptions as nexceptions

PG_EPG = 'endpoint_group'
PG_EPGS = 'endpoint-groups'

extensions.append_api_extensions_path(
    networking_plumgrid.neutron.plugins.extensions.__path__)

class NoEndpointGroupFound(nexceptions.NotFound):
    message = _("Endpoint Group with id %(id)s does not exist")

class UpdateParametersRequired(nexceptions.InvalidInput):
    message = _("No update parameter specified atleast one needed")

class SGUpdateDisallowed(nexceptions.InvalidInput):
    message = _("Update for Security Group parameters is not allowed.")

RESOURCE_ATTRIBUTE_MAP = {
    'endpoint_group': {
        'id': {
            'allow_post': False,
            'allow_put': False,
            'validate': {
                'type:uuid': None
            },
            'is_visible': True,
            'primary_key': True
        },
        'name': {
            'allow_post': True,
            'allow_put': True,
            'is_visible': True,
            'default': ''
        },
        'description': {
            'allow_post': True,
            'allow_put': True,
            'is_visible': True,
            'default': ''
        },
        'policy_tag_id': {
            'allow_post': True,
            'allow_put': True,
            'is_visible': True,
            'default': None,
        },
        'is_security_group': {
            'allow_post': False,
            'allow_put': False,
            'is_visible': True,
            'default': False,
            'validate': {'type:boolean': None}

        },
        'add_tag': {
            'allow_post': True,
            'allow_put': True,
            'is_visible': True,
            'default': None,
        },
        'remove_tag': {
            'allow_post': True,
            'allow_put': True,
            'is_visible': True,
            'default': None,
        },
        'tenant_id': {'allow_post': True,
                      'allow_put': False,
                      'required_by_policy': True,
                      'validate': {'type:string': attr.TENANT_ID_MAX_LEN},
                      'is_visible': True},
    }
}

class Endpointgroup(extensions.ExtensionDescriptor):

    @classmethod
    def get_name(cls):
        return "Endpoint Group"

    @classmethod
    def get_alias(cls):
        return "endpoint-group"

    @classmethod
    def get_description(cls):
        return "This API will be used to create endpoint groups" \
               " from Neutron and map it in PLUMgrid."

    @classmethod
    def get_namespace(cls):
        return "http://docs.openstack.org/ext/endpoint_group" \
               "/api/v2.0"

    @classmethod
    def get_updated(cls):
        return "2016-01-01T00:00:00-00:00"

    @classmethod
    def get_resources(cls):
        exts = []
        plugin = manager.NeutronManager.get_plugin()

        resource_name = PG_EPG
        collection_name = PG_EPGS
        params = RESOURCE_ATTRIBUTE_MAP.get(resource_name, dict())
        controller = base.create_resource(
            collection_name, resource_name, plugin, params)
        ex = extensions.ResourceExtension(collection_name,
                                          controller)
        exts.append(ex)
        return exts


text:
title: Serve JSON on a Specific Route
localeTitle: Servir JSON en una ruta específica
---
## Servir JSON en una ruta específica

Es bastante simple servir un objeto json con nodo (en la ruta '/ json'), si queremos enviar un mensaje y darle el valor "Hola mundo", podemos hacerlo así:

```javascript
  app.get("/json", function(req, res) {
        res.json({"message": "Hello World"});
  });
```

[Ayude a nuestra comunidad a expandir estos consejos y guías](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/apis-and-microservices/basic-node-and-express/serve-json-on-a-specific-route/index.md) .


text:
ROOT=$(pwd)
FIS_CONFIG_TEMPLATE="$ROOT/fis-conf.js"
FRAMEWORKS=(
    fis-plus
)

if [ "$1" = "" ];then
    output="output"
else
    output=$1
fi

domain=

if [ "$2" != "dev" ]; then
    domain="\/fis-plus"
fi

isDev=

if [ "$2" = "dev" ]; then
    isDev="dev"
    FRAMEWORKS=(
        fis-plus
    )
else
    export PATH=$ROOT/node_modules/.bin:$PATH
    export NODE_PATH=$ROOT/node_modules
fi

gitpush_gh () {
    framework=$1
    git clone https://github.com/fex-team/${framework}.git
    cd "$framework"

    git checkout gh-pages
    echo $GIT_NAME
    git config --global user.email "${GIT_EMAIL}"
    git config --global user.name "${GIT_NAME}"
    git config credential.helper "store --file=.git/credential"
    echo "https://${GH_TOKEN}:@github.com" > .git/credential

    rm -rf * #clear
    cp -rf ../output/* .

    git add -A -f
    git commit -m 'auto commit' -a
    git push origin gh-pages

    cd ..
    rm -rf "$framework"
}

for framework in "${FRAMEWORKS[@]}"; do
    echo $framework

    if [ "$isDev" = "" ]; then
        rm -rf $ROOT/doc
    fi

    subpath=$framework
    domain="\/${framework}"
    if [ "$isDev" != "" ]; then
        subpath="."
        domain=
    fi

    # concat files
    cat $FIS_CONFIG_TEMPLATE | sed s/{%FRAMEWORK%}/${subpath}/g > fis-conf-${framework}.js
    cat fis-conf-${framework}.js | sed s/{%DOMAIN%}/${domain}/g > fis-conf-${framework}_tmp.js
    mv fis-conf-${framework}_tmp.js fis-conf-${framework}.js

    if [ "$isDev" = "" ]; then
        echo 'test'
        git clone https://github.com/fex-team/${framework}.wiki.git $ROOT/doc
    fi

    fis release -cmpDd $output -f fis-conf-${framework}.js

    if [ "$?" = "0" -a -d "./output" ]; then
        gitpush_gh "$framework"
        rm -rf fis-conf-${framework}.js
        rm -rf output
        # 删除该项目的doc,以便下一个项目载入新的doc
        # rm -rf doc 此处作废
    fi
done


text:
package client

import (
	"context"
	"crypto/rand"
	"math/big"
	"sync"

	"github.com/keybase/client/go/protocol/chat1"
)

type DelegateChatUI struct {
	sync.Mutex
	// sessionID -> chatUI
	chatUIs map[int]chat1.ChatUiInterface
}

var _ chat1.ChatUiInterface = (*DelegateChatUI)(nil)

func newDelegateChatUI() *DelegateChatUI {
	return &DelegateChatUI{
		chatUIs: make(map[int]chat1.ChatUiInterface),
	}
}

func getSessionID(chatUI chat1.ChatUiInterface) int {
	switch ui := chatUI.(type) {
	case *ChatAPIUI:
		return ui.sessionID
	case *ChatCLIUI:
		return ui.sessionID
	default:
		return 0
	}
}

func randSessionID() int {
	sessionID, err := rand.Int(rand.Reader, big.NewInt(int64(1<<32)))
	if err != nil {
		return 0
	}
	return int(sessionID.Int64())
}

func (c *DelegateChatUI) RegisterChatUI(chatUI chat1.ChatUiInterface) {
	c.Lock()
	defer c.Unlock()
	sessionID := getSessionID(chatUI)
	c.chatUIs[sessionID] = chatUI
}

func (c *DelegateChatUI) DeregisterChatUI(chatUI chat1.ChatUiInterface) {
	c.Lock()
	defer c.Unlock()
	sessionID := getSessionID(chatUI)
	delete(c.chatUIs, sessionID)
}

func (c *DelegateChatUI) getChatUI(sessionID int) *chat1.ChatUiInterface {
	c.Lock()
	defer c.Unlock()
	if chatUI, ok := c.chatUIs[sessionID]; ok {
		return &chatUI
	}
	return nil
}

func (c *DelegateChatUI) ChatInboxConversation(ctx context.Context, arg chat1.ChatInboxConversationArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatInboxConversation(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatInboxLayout(ctx context.Context, arg chat1.ChatInboxLayoutArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatInboxLayout(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatInboxFailed(ctx context.Context, arg chat1.ChatInboxFailedArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatInboxFailed(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatInboxUnverified(ctx context.Context, arg chat1.ChatInboxUnverifiedArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatInboxUnverified(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatThreadCached(ctx context.Context, arg chat1.ChatThreadCachedArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatThreadCached(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatThreadFull(ctx context.Context, arg chat1.ChatThreadFullArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatThreadFull(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatThreadStatus(ctx context.Context, arg chat1.ChatThreadStatusArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatThreadStatus(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatConfirmChannelDelete(ctx context.Context, arg chat1.ChatConfirmChannelDeleteArg) (bool, error) {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatConfirmChannelDelete(ctx, arg)
	}
	return true, nil
}

func (c *DelegateChatUI) ChatSearchHit(ctx context.Context, arg chat1.ChatSearchHitArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatSearchHit(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatSearchDone(ctx context.Context, arg chat1.ChatSearchDoneArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatSearchDone(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatSearchInboxStart(ctx context.Context, sessionID int) error {
	if chatUI := c.getChatUI(sessionID); chatUI != nil {
		return (*chatUI).ChatSearchInboxStart(ctx, sessionID)
	}
	return nil
}

func (c *DelegateChatUI) ChatSearchInboxHit(ctx context.Context, arg chat1.ChatSearchInboxHitArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatSearchInboxHit(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatSearchInboxDone(ctx context.Context, arg chat1.ChatSearchInboxDoneArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatSearchInboxDone(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatSearchIndexStatus(ctx context.Context, arg chat1.ChatSearchIndexStatusArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatSearchIndexStatus(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatSearchConvHits(ctx context.Context, arg chat1.ChatSearchConvHitsArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatSearchConvHits(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatSearchTeamHits(ctx context.Context, arg chat1.ChatSearchTeamHitsArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatSearchTeamHits(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatSearchBotHits(ctx context.Context, arg chat1.ChatSearchBotHitsArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatSearchBotHits(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatStellarDataConfirm(ctx context.Context, arg chat1.ChatStellarDataConfirmArg) (bool, error) {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatStellarDataConfirm(ctx, arg)
	}
	return true, nil
}

func (c *DelegateChatUI) ChatStellarShowConfirm(ctx context.Context, sessionID int) error {
	if chatUI := c.getChatUI(sessionID); chatUI != nil {
		return (*chatUI).ChatStellarShowConfirm(ctx, sessionID)
	}
	return nil
}

func (c *DelegateChatUI) ChatStellarDataError(ctx context.Context, arg chat1.ChatStellarDataErrorArg) (bool, error) {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatStellarDataError(ctx, arg)
	}
	return false, nil
}

func (c *DelegateChatUI) ChatStellarDone(ctx context.Context, arg chat1.ChatStellarDoneArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatStellarDone(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatGiphySearchResults(ctx context.Context, arg chat1.ChatGiphySearchResultsArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatGiphySearchResults(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatGiphyToggleResultWindow(ctx context.Context,
	arg chat1.ChatGiphyToggleResultWindowArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatGiphyToggleResultWindow(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatShowManageChannels(ctx context.Context, arg chat1.ChatShowManageChannelsArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatShowManageChannels(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatCoinFlipStatus(ctx context.Context, arg chat1.ChatCoinFlipStatusArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatCoinFlipStatus(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatCommandMarkdown(ctx context.Context, arg chat1.ChatCommandMarkdownArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatCommandMarkdown(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatMaybeMentionUpdate(ctx context.Context, arg chat1.ChatMaybeMentionUpdateArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatMaybeMentionUpdate(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatLoadGalleryHit(ctx context.Context, arg chat1.ChatLoadGalleryHitArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatLoadGalleryHit(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatWatchPosition(ctx context.Context, arg chat1.ChatWatchPositionArg) (chat1.LocationWatchID, error) {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatWatchPosition(ctx, arg)
	}
	return chat1.LocationWatchID(0), nil
}

func (c *DelegateChatUI) ChatClearWatch(ctx context.Context, arg chat1.ChatClearWatchArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatClearWatch(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatCommandStatus(ctx context.Context, arg chat1.ChatCommandStatusArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatCommandStatus(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) ChatBotCommandsUpdateStatus(ctx context.Context, arg chat1.ChatBotCommandsUpdateStatusArg) error {
	if chatUI := c.getChatUI(arg.SessionID); chatUI != nil {
		return (*chatUI).ChatBotCommandsUpdateStatus(ctx, arg)
	}
	return nil
}

func (c *DelegateChatUI) TriggerContactSync(ctx context.Context, sessionID int) error {
	if chatUI := c.getChatUI(sessionID); chatUI != nil {
		return (*chatUI).TriggerContactSync(ctx, sessionID)
	}
	return nil
}