text:
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.customtabs;

import androidx.annotation.IntDef;
import androidx.browser.customtabs.CustomTabsSessionToken;

import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider;
import org.chromium.chrome.browser.customtabs.content.CustomTabActivityTabProvider;
import org.chromium.chrome.browser.dependency_injection.ActivityScope;
import org.chromium.chrome.browser.gsa.GSAState;
import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher;
import org.chromium.chrome.browser.lifecycle.StartStopWithNativeObserver;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabAssociatedApp;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import javax.inject.Inject;

/**
 * Keeps the client app alive, when possible, while CustomTabActivity is in foreground (see
 * {@link CustomTabsConnection#keepAliveForSession}).
 */
@ActivityScope
public class CustomTabActivityClientConnectionKeeper implements StartStopWithNativeObserver {

    @IntDef({ConnectionStatus.DISCONNECTED, ConnectionStatus.DISCONNECTED_KEEP_ALIVE,
            ConnectionStatus.CONNECTED, ConnectionStatus.CONNECTED_KEEP_ALIVE})
    @Retention(RetentionPolicy.SOURCE)
    private @interface ConnectionStatus {
        int DISCONNECTED = 0;
        int DISCONNECTED_KEEP_ALIVE = 1;
        int CONNECTED = 2;
        int CONNECTED_KEEP_ALIVE = 3;
        int NUM_ENTRIES = 4;
    }

    private final CustomTabsConnection mConnection;
    private final BrowserServicesIntentDataProvider mIntentDataProvider;
    private final CustomTabActivityTabProvider mTabProvider;

    private boolean mIsKeepingAlive;

    @Inject
    public CustomTabActivityClientConnectionKeeper(CustomTabsConnection connection,
            BrowserServicesIntentDataProvider intentDataProvider,
            ActivityLifecycleDispatcher lifecycleDispatcher,
            CustomTabActivityTabProvider tabProvider) {
        mConnection = connection;
        mIntentDataProvider = intentDataProvider;
        mTabProvider = tabProvider;
        lifecycleDispatcher.register(this);
    }

    @Override
    public void onStartWithNative() {
        mIsKeepingAlive = mConnection.keepAliveForSession(
                mIntentDataProvider.getSession(), mIntentDataProvider.getKeepAliveServiceIntent());
    }

    @Override
    public void onStopWithNative() {
        mConnection.dontKeepAliveForSession(mIntentDataProvider.getSession());
        mIsKeepingAlive = false;
    }

    /**
     * Records current client connection status.
     */
    public void recordClientConnectionStatus() {
        Tab tab = mTabProvider.getTab();
        String packageName = tab == null ? null : TabAssociatedApp.getAppId(tab);
        if (packageName == null) return; // No associated package

        CustomTabsSessionToken session = mIntentDataProvider.getSession();
        boolean isConnected =
                packageName.equals(mConnection.getClientPackageNameForSession(session));
        int status = -1;
        if (isConnected) {
            if (mIsKeepingAlive) {
                status = ConnectionStatus.CONNECTED_KEEP_ALIVE;
            } else {
                status = ConnectionStatus.CONNECTED;
            }
        } else {
            if (mIsKeepingAlive) {
                status = ConnectionStatus.DISCONNECTED_KEEP_ALIVE;
            } else {
                status = ConnectionStatus.DISCONNECTED;
            }
        }
        assert status >= 0;

        if (GSAState.isGsaPackageName(packageName)) {
            RecordHistogram.recordEnumeratedHistogram("CustomTabs.ConnectionStatusOnReturn.GSA",
                    status, ConnectionStatus.NUM_ENTRIES);
        } else {
            RecordHistogram.recordEnumeratedHistogram("CustomTabs.ConnectionStatusOnReturn.NonGSA",
                    status, ConnectionStatus.NUM_ENTRIES);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) FuseSource, Inc.
  http://fusesource.com

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
    ">

  <bean id="audit" class="org.foo.CustomerService"/>

  <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
    <route>
      <from uri="direct:start"/>
      <to uri="bean:audit?method=auditCustomer"/>
    </route>
  </camelContext>

  <bean id="dozerWatcher" class="org.fusesource.fabric.dozer.file.FileWatcherMapping" init-method="init" destroy-method="destroy">
    <property name="camelContext" ref="myCamel"/>
    <property name="rootPath" value="target/test-classes"/>
  </bean>

  <!--<bean id="myDataFormat" class="org.fusesource.fabric.jaxb.dynamic.DynamicJaxbDataFormat">-->
    <!--<property name="compiler">-->
      <!--<bean class="org.fusesource.fabric.jaxb.dynamic.watcher.FileWatcherDynamicCompiler"-->
            <!--init-method="init" destroy-method="destroy">-->
        <!--<property name="rootPath" value="src/test/resources/xsds"/>-->
      <!--</bean>-->
    <!--</property>-->
  <!--</bean>-->

</beans>

redpajama_set_name: RedPajamaGithub


text:
==========
ChatterBot
==========

The main class :code:`ChatBot` is a connecting point between each of
ChatterBot's :term:`adapters`. In this class, an input statement is returned
from the :term:`input adapter`, processed and stored by the :term:`logic adapter`
and :term:`storage adapter`, and then passed to the output adapter to be returned
to the user.

.. autoclass:: chatterbot.ChatBot
   :members:

   :param name: A name is the only required parameter for the ChatBot class.
   :type name: str

   :param storage_adapter: The import path to a storage adapter class.
   :type storage_adapter: str

   :param logic_adapters: A list of string paths to each logic adapter the bot uses.
   :type logic_adapters: list

   :param input_adapter: The import path to an input adapter class.
   :type input_adapter: str

   :param output_adapter: The import path to an output adapter class.
   :type output_adapter: str

   :param trainer: The import path to the training class to be used with the chat bot.
   :type trainer: str

   :param filters: A list of import paths to filter classes to be used by the chat bot.
   :type filters: list

   :param logger: A :code:`Logger` object.
   :type logger: logging.Logger

Example chat bot parameters
===========================

.. code-block:: python

   ChatBot(
       'Northumberland',
       storage_adapter='my.storage.AdapterClass',
       logic_adapters=[
           'my.logic.AdapterClass1',
           'my.logic.AdapterClass2'
       ],
       input_adapter='my.input.AdapterClass',
       output_adapter='my.output.AdapterClass',
       trainer='my.trainer.TrainerClass',
       filters=[
           'my.filter.FilterClass1',
           'my.filter.FilterClass2'
       ],
       logger=custom_logger
   )

Example expanded chat bot parameters
====================================

It is also possible to pass parameters directly to individual adapters.
To do this, you must use a dictionary that contains a key called :code:`import_path`
which specifies the import path to the adapter class.

.. code-block:: python

   ChatBot(
       'Leander Jenkins',
       storage_adapter={
           'import_path': 'my.storage.AdapterClass',
           'database_name': 'my-database'
       },
       logic_adapters=[
           {
               'import_path': 'my.logic.AdapterClass1',
               'statement_comparison_function': 'chatterbot.comparisons.levenshtein_distance'
               'response_selection_method': 'chatterbot.response_selection.get_first_response'
           },
           {
               'import_path': 'my.logic.AdapterClass2',
               'statement_comparison_function': 'my.custom.comparison_function'
               'response_selection_method': 'my.custom.selection_method'
           }
       ],
       input_adapter={
           'import_path': 'my.input.AdapterClass',
           'api_key': '0000-1111-2222-3333-DDDD'
       },
       output_adapter={
           'import_path': 'my.output.AdapterClass',
           'api_key': '0000-1111-2222-3333-DDDD'
       }
   )

Enable logging
==============

ChatterBot has built in logging. You can enable ChatterBot's
logging by setting the logging level in your code.

.. code-block:: python

   import logging

   logging.basicConfig(level=logging.INFO)

   ChatBot(
       # ...
   )

The logging levels available are :code:`CRITICAL`, :code:`ERROR`, :code:`WARNING`, :code:`INFO`, :code:`DEBUG`, and :code:`NOTSET`.
See the `Python logging documentation`_ for more information.

Using a custom logger
=====================

You can choose to use your own custom logging class with your chat bot.
This can be useful when testing and debugging your code.

.. code-block:: python

   import logging

   custom_logger = logging.getLogger(__name__)

   ChatBot(
       # ...
       logger=custom_logger
   )

Adapters
========

ChatterBot uses adapter modules to control the behavior of specific types of tasks.
There are four distinct types of adapters that ChatterBot uses,
these are storage adapters, input adapters, output adapters and logic adapters.

Adapters types
--------------

1. Storage adapters - Provide an interface for ChatterBot to connect to various storage systems such as `MongoDB`_ or local file storage.
2. Input adapters - Provide methods that allow ChatterBot to get input from a defined data source.
3. Output adapters - Provide methods that allow ChatterBot to return a response to a defined data source.
4. Logic adapters - Define the logic that ChatterBot uses to respond to input it receives.

Accessing the chatbot instance
-------------------------------

When ChatterBot initializes each adapter, it sets an attribute named :code:`chatbot`.
The chatbot variable makes it possible for each adapter to have access to all of the other adapters being used.
Suppose two input and output adapters need to share some information or perhaps you want to give your logic adapter
direct access to the storage adapter. These are just a few cases where this functionality is useful.

Each adapter can be accessed on the chatbot object from within an adapter by referencing `self.chatbot`.
Then, :code:`self.chatbot.storage` refers to the storage adapter, :code:`self.chatbot.input` refers to the input adapter,
:code:`self.chatbot.output` refers to the current output adapter, and :code:`self.chatbot.logic` refers to the logic adapters.

Adapter defaults
----------------

By default, ChatterBot uses the `JsonFileStorageAdapter` adapter for storage,
the `BestMatch` for logic, the `VariableInputTypeAdapter` for input
and the `OutputAdapter` for output.

Each adapter can be set by passing in the dot-notated import path to the constructor as shown.

.. code-block:: python

   bot = ChatBot(
       "Elsie",
       storage_adapter="chatterbot.storage.JsonFileStorageAdapter",
       input_adapter="chatterbot.input.VariableInputTypeAdapter",
       output_adapter="chatterbot.output.OutputAdapter",
       logic_adapters=[
           "chatterbot.logic.BestMatch"
       ],
   )

.. _MongoDB: https://docs.mongodb.com/
.. _`Python logging documentation`: https://docs.python.org/3/library/logging.html#logging-levels


text:
set :application, "matterhorn"
set :repository,  "https://github.com/avalonmediasystem/avalon-felix/archive"
set(:rails_env) { "development" }

set(:deployment_host) { "lancelot.dlib.indiana.edu" }  # Host(s) to deploy to
set(:deploy_to) { "/usr/local/matterhorn" }  # Directory to deploy into
set(:user) { 'vov' }                # User to deploy as
set(:branch) { "release/1.0.0" }       # Git branch to deploy
ssh_options[:keys] = ["/opt/staging/avalon/vov_deployment_key"]

set :bundle_without, [:production]

role :web, deployment_host
role :app, deployment_host
role :db, deployment_host, :primary => true

before "deploy:update_code", "deploy:stop"
after "deploy:update_code", "deploy:copy_config"

namespace :deploy do
  task :migrate do
    puts "    not doing migrate because not a Rails application."
  end

  task :update_code do
    run "#{sudo :as => 'matterhorn'} -i -- sh -c 'cd #{deploy_to}; rm -rf current; wget --no-check-certificate #{repository}/#{branch}.zip -O #{application}.zip; unzip #{application}.zip; mv avalon-felix-release-1.0.0 current; rm -f *.zip'"
  end

  task :copy_config do
    run "#{sudo :as => 'matterhorn'} -i -- sh -c 'cd #{deploy_to}; cp shared/config.properties current/etc/'"
  end

  task :create_symlink do
    puts "    not doing create_symlink because not a Rails application."
  end

  task :start do
    sudo "service #{application} start"
  end

  task :stop do
    sudo "service #{application} stop"
  end

  task :restart do
    sudo "service #{application} restart"
  end
end


text:
/* $Xorg: auth.h,v 1.4 2001/02/09 02:05:59 xorgcvs Exp $ */
/******************************************************************************

Copyright 1993, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
******************************************************************************/
/* $XFree86: xc/programs/xsm/auth.h,v 1.5 2001/08/01 00:45:07 tsi Exp $ */

#ifndef _AUTH_H_
#define _AUTH_H_

#include <X11/ICE/ICEutil.h>

extern Bool HostBasedAuthProc(char *hostname);
extern Status SetAuthentication(int count, IceListenObj *listenObjs,
				IceAuthDataEntry **authDataEntries);
extern void FreeAuthenticationData(int count,
				   IceAuthDataEntry *authDataEntries);

#endif


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />

<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" />
<title>File - Android SDK | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
<link href="../../../assets/css/default.css" rel="stylesheet" type="text/css">

<link href="../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

          	Quicknav
			      Quicknav

                  Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../')"
onkeyup="return search_changed(event, false, '../../../')" />
      </form>

        close

Get Started

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Get the SDK

Google Services

Google Play

Publishing

Promoting

App Quality

Spotlight

Open Distribution

Results

Loading...

Training

API Guides

Reference

Tools

Google Services

to top

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  android

  android.accessibilityservice

  android.accounts

  android.animation

  android.app

  android.app.admin

  android.app.backup

  android.appwidget

  android.bluetooth

  android.content

  android.content.pm

  android.content.res

  android.database

  android.database.sqlite

  android.drm

  android.gesture

  android.graphics

  android.graphics.drawable

  android.graphics.drawable.shapes

  android.graphics.pdf

  android.hardware

  android.hardware.display

  android.hardware.input

  android.hardware.location

  android.hardware.usb

  android.inputmethodservice

  android.location

  android.media

  android.media.audiofx

  android.media.effect

  android.mtp

  android.net

  android.net.http

  android.net.nsd

  android.net.rtp

  android.net.sip

  android.net.wifi

  android.net.wifi.p2p

  android.net.wifi.p2p.nsd

  android.nfc

  android.nfc.cardemulation

  android.nfc.tech

  android.opengl

  android.os

  android.os.storage

  android.preference

  android.print

  android.print.pdf

  android.printservice

  android.provider

  android.renderscript

  android.sax

  android.security

  android.service.dreams

  android.service.notification

  android.service.textservice

  android.service.wallpaper

  android.speech

  android.speech.tts

  android.support.v13.app

  android.support.v4.accessibilityservice

  android.support.v4.app

  android.support.v4.content

  android.support.v4.content.pm

  android.support.v4.database

  android.support.v4.graphics.drawable

  android.support.v4.hardware.display

  android.support.v4.media

  android.support.v4.net

  android.support.v4.os

  android.support.v4.print

  android.support.v4.text

  android.support.v4.util

  android.support.v4.view

  android.support.v4.view.accessibility

  android.support.v4.widget

  android.support.v7.app

  android.support.v7.appcompat

  android.support.v7.gridlayout

  android.support.v7.media

  android.support.v7.mediarouter

  android.support.v7.view

  android.support.v7.widget

  android.support.v8.renderscript

  android.telephony

  android.telephony.cdma

  android.telephony.gsm

  android.test

  android.test.mock

  android.test.suitebuilder

  android.text

  android.text.format

  android.text.method

  android.text.style

  android.text.util

  android.transition

  android.util

  android.view

  android.view.accessibility

  android.view.animation

  android.view.inputmethod

  android.view.textservice

  android.webkit

  android.widget

  dalvik.bytecode

  dalvik.system

  java.awt.font

  java.beans

  java.io

  java.lang

  java.lang.annotation

  java.lang.ref

  java.lang.reflect

  java.math

  java.net

  java.nio

  java.nio.channels

  java.nio.channels.spi

  java.nio.charset

  java.nio.charset.spi

  java.security

  java.security.acl

  java.security.cert

  java.security.interfaces

  java.security.spec

  java.sql

  java.text

  java.util

  java.util.concurrent

  java.util.concurrent.atomic

  java.util.concurrent.locks

  java.util.jar

  java.util.logging

  java.util.prefs

  java.util.regex

  java.util.zip

  javax.crypto

  javax.crypto.interfaces

  javax.crypto.spec

  javax.microedition.khronos.egl

  javax.microedition.khronos.opengles

  javax.net

  javax.net.ssl

  javax.security.auth

  javax.security.auth.callback

  javax.security.auth.login

  javax.security.auth.x500

  javax.security.cert

  javax.sql

  javax.xml

  javax.xml.datatype

  javax.xml.namespace

  javax.xml.parsers

  javax.xml.transform

  javax.xml.transform.dom

  javax.xml.transform.sax

  javax.xml.transform.stream

  javax.xml.validation

  javax.xml.xpath

  junit.framework

  junit.runner

  org.apache.http

  org.apache.http.auth

  org.apache.http.auth.params

  org.apache.http.client

  org.apache.http.client.entity

  org.apache.http.client.methods

  org.apache.http.client.params

  org.apache.http.client.protocol

  org.apache.http.client.utils

  org.apache.http.conn

  org.apache.http.conn.params

  org.apache.http.conn.routing

  org.apache.http.conn.scheme

  org.apache.http.conn.ssl

  org.apache.http.conn.util

  org.apache.http.cookie

  org.apache.http.cookie.params

  org.apache.http.entity

  org.apache.http.impl

  org.apache.http.impl.auth

  org.apache.http.impl.client

  org.apache.http.impl.conn

  org.apache.http.impl.conn.tsccm

  org.apache.http.impl.cookie

  org.apache.http.impl.entity

  org.apache.http.impl.io

  org.apache.http.io

  org.apache.http.message

  org.apache.http.params

  org.apache.http.protocol

  org.apache.http.util

  org.json

  org.w3c.dom

  org.w3c.dom.ls

  org.xml.sax

  org.xml.sax.ext

  org.xml.sax.helpers

  org.xmlpull.v1

  org.xmlpull.v1.sax2

Interfaces

Closeable

DataInput

DataOutput

Externalizable

FileFilter

FilenameFilter

Flushable

ObjectInput

ObjectInputValidation

ObjectOutput

ObjectStreamConstants

Serializable

Classes

BufferedInputStream

BufferedOutputStream

BufferedReader

BufferedWriter

ByteArrayInputStream

ByteArrayOutputStream

CharArrayReader

CharArrayWriter

Console

DataInputStream

DataOutputStream

File

FileDescriptor

FileInputStream

FileOutputStream

FilePermission

FileReader

FileWriter

FilterInputStream

FilterOutputStream

FilterReader

FilterWriter

InputStream

InputStreamReader

LineNumberInputStream

LineNumberReader

ObjectInputStream

ObjectInputStream.GetField

ObjectOutputStream

ObjectOutputStream.PutField

ObjectStreamClass

ObjectStreamField

OutputStream

OutputStreamWriter

PipedInputStream

PipedOutputStream

PipedReader

PipedWriter

PrintStream

PrintWriter

PushbackInputStream

PushbackReader

RandomAccessFile

Reader

SequenceInputStream

SerializablePermission

StreamTokenizer

StringBufferInputStream

StringReader

StringWriter

Writer

Exceptions

CharConversionException

EOFException

FileNotFoundException

InterruptedIOException

InvalidClassException

InvalidObjectException

IOException

NotActiveException

NotSerializableException

ObjectStreamException

OptionalDataException

StreamCorruptedException

SyncFailedException

UnsupportedEncodingException

UTFDataFormatException

WriteAbortedException

Errors

IOError

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  Fields

  | Ctors

  | Methods

  | Inherited Methods

| [Expand All]

  Added in API level 1

    public

    class

File

    extends Object

      implements

        Serializable

        Comparable<T>

        java.lang.Object

               ↳

        java.io.File

Class Overview

An "abstract" representation of a file system entity identified by a
 pathname. The pathname may be absolute (relative to the root directory
 of the file system) or relative to the current directory in which the program
 is running.

The actual file referenced by a File may or may not exist. It may
 also, despite the name File, be a directory or other non-regular
 file.

This class provides limited functionality for getting/setting file
 permissions, file type, and last modified time.

On Android strings are converted to UTF-8 byte sequences when sending filenames to
 the operating system, and byte sequences returned by the operating system (from the
 various list methods) are converted to strings by decoding them as UTF-8
 byte sequences.

See Also

Serializable

Comparable

Summary

Fields

          <nobr>
          public
          static
          final
          String</nobr>
          pathSeparator
          The system-dependent string used to separate components in search paths (":").

          <nobr>
          public
          static
          final
          char</nobr>
          pathSeparatorChar
          The system-dependent character used to separate components in search paths (':').

          <nobr>
          public
          static
          final
          String</nobr>
          separator
          The system-dependent string used to separate components in filenames ('/').

          <nobr>
          public
          static
          final
          char</nobr>
          separatorChar
          The system-dependent character used to separate components in filenames ('/').

Public Constructors

        <nobr>

            </nobr>

        <nobr>
        File(File dir, String name)</nobr>

Constructs a new file using the specified directory and name.

        <nobr>

            </nobr>

        <nobr>
        File(String path)</nobr>

Constructs a new file using the specified path.

        <nobr>

            </nobr>

        <nobr>
        File(String dirPath, String name)</nobr>

Constructs a new File using the specified directory path and file name,
 placing a path separator between the two.

        <nobr>

            </nobr>

        <nobr>
        File(URI uri)</nobr>

Constructs a new File using the path of the specified URI.

Public Methods

        <nobr>

            boolean</nobr>

        <nobr>
        canExecute()</nobr>

Tests whether or not this process is allowed to execute this file.

        <nobr>

            boolean</nobr>

        <nobr>
        canRead()</nobr>

Indicates whether the current context is allowed to read from this file.

        <nobr>

            boolean</nobr>

        <nobr>
        canWrite()</nobr>

Indicates whether the current context is allowed to write to this file.

        <nobr>

            int</nobr>

        <nobr>
        compareTo(File another)</nobr>

Returns the relative sort ordering of the paths for this file and the
 file another.

        <nobr>

            boolean</nobr>

        <nobr>
        createNewFile()</nobr>

Creates a new, empty file on the file system according to the path
 information stored in this file.

        <nobr>

            static

            File</nobr>

        <nobr>
        createTempFile(String prefix, String suffix, File directory)</nobr>

Creates an empty temporary file in the given directory using the given
 prefix and suffix as part of the file name.

        <nobr>

            static

            File</nobr>

        <nobr>
        createTempFile(String prefix, String suffix)</nobr>

Creates an empty temporary file using the given prefix and suffix as part
 of the file name.

        <nobr>

            boolean</nobr>

        <nobr>
        delete()</nobr>

Deletes this file.

        <nobr>

            void</nobr>

        <nobr>
        deleteOnExit()</nobr>

Schedules this file to be automatically deleted when the VM terminates normally.

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object obj)</nobr>

Compares obj to this file and returns true if they
 represent the same object using a path specific comparison.

        <nobr>

            boolean</nobr>

        <nobr>
        exists()</nobr>

Returns a boolean indicating whether this file can be found on the
 underlying file system.

        <nobr>

            File</nobr>

        <nobr>
        getAbsoluteFile()</nobr>

Returns a new file constructed using the absolute path of this file.

        <nobr>

            String</nobr>

        <nobr>
        getAbsolutePath()</nobr>

Returns the absolute path of this file.

        <nobr>

            File</nobr>

        <nobr>
        getCanonicalFile()</nobr>

Returns a new file created using the canonical path of this file.

        <nobr>

            String</nobr>

        <nobr>
        getCanonicalPath()</nobr>

Returns the canonical path of this file.

        <nobr>

            long</nobr>

        <nobr>
        getFreeSpace()</nobr>

Returns the number of free bytes on the partition containing this path.

        <nobr>

            String</nobr>

        <nobr>
        getName()</nobr>

Returns the name of the file or directory represented by this file.

        <nobr>

            String</nobr>

        <nobr>
        getParent()</nobr>

Returns the pathname of the parent of this file.

        <nobr>

            File</nobr>

        <nobr>
        getParentFile()</nobr>

Returns a new file made from the pathname of the parent of this file.

        <nobr>

            String</nobr>

        <nobr>
        getPath()</nobr>

Returns the path of this file.

        <nobr>

            long</nobr>

        <nobr>
        getTotalSpace()</nobr>

Returns the total size in bytes of the partition containing this path.

        <nobr>

            long</nobr>

        <nobr>
        getUsableSpace()</nobr>

Returns the number of usable free bytes on the partition containing this path.

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

Returns an integer hash code for the receiver.

        <nobr>

            boolean</nobr>

        <nobr>
        isAbsolute()</nobr>

Indicates if this file's pathname is absolute.

        <nobr>

            boolean</nobr>

        <nobr>
        isDirectory()</nobr>

Indicates if this file represents a directory on the
 underlying file system.

        <nobr>

            boolean</nobr>

        <nobr>
        isFile()</nobr>

Indicates if this file represents a file on the underlying
 file system.

        <nobr>

            boolean</nobr>

        <nobr>
        isHidden()</nobr>

Returns whether or not this file is a hidden file as defined by the
 operating system.

        <nobr>

            long</nobr>

        <nobr>
        lastModified()</nobr>

Returns the time when this file was last modified, measured in
 milliseconds since January 1st, 1970, midnight.

        <nobr>

            long</nobr>

        <nobr>
        length()</nobr>

Returns the length of this file in bytes.

        <nobr>

            String[]</nobr>

        <nobr>
        list()</nobr>

Returns an array of strings with the file names in the directory
 represented by this file.

        <nobr>

            String[]</nobr>

        <nobr>
        list(FilenameFilter filter)</nobr>

Gets a list of the files in the directory represented by this file.

        <nobr>

            File[]</nobr>

        <nobr>
        listFiles()</nobr>

Returns an array of files contained in the directory represented by this
 file.

        <nobr>

            File[]</nobr>

        <nobr>
        listFiles(FilenameFilter filter)</nobr>

Gets a list of the files in the directory represented by this file.

        <nobr>

            File[]</nobr>

        <nobr>
        listFiles(FileFilter filter)</nobr>

Gets a list of the files in the directory represented by this file.

        <nobr>

            static

            File[]</nobr>

        <nobr>
        listRoots()</nobr>

Returns the file system roots.

        <nobr>

            boolean</nobr>

        <nobr>
        mkdir()</nobr>

Creates the directory named by this file, assuming its parents exist.

        <nobr>

            boolean</nobr>

        <nobr>
        mkdirs()</nobr>

Creates the directory named by this file, creating missing parent
 directories if necessary.

        <nobr>

            boolean</nobr>

        <nobr>
        renameTo(File newPath)</nobr>

Renames this file to newPath.

        <nobr>

            boolean</nobr>

        <nobr>
        setExecutable(boolean executable)</nobr>

Equivalent to setExecutable(executable, true).

        <nobr>

            boolean</nobr>

        <nobr>
        setExecutable(boolean executable, boolean ownerOnly)</nobr>

Manipulates the execute permissions for the abstract path designated by
 this file.

        <nobr>

            boolean</nobr>

        <nobr>
        setLastModified(long time)</nobr>

Sets the time this file was last modified, measured in milliseconds since
 January 1st, 1970, midnight.

        <nobr>

            boolean</nobr>

        <nobr>
        setReadOnly()</nobr>

Equivalent to setWritable(false, false).

        <nobr>

            boolean</nobr>

        <nobr>
        setReadable(boolean readable)</nobr>

Equivalent to setReadable(readable, true).

        <nobr>

            boolean</nobr>

        <nobr>
        setReadable(boolean readable, boolean ownerOnly)</nobr>

Manipulates the read permissions for the abstract path designated by this
 file.

        <nobr>

            boolean</nobr>

        <nobr>
        setWritable(boolean writable, boolean ownerOnly)</nobr>

Manipulates the write permissions for the abstract path designated by this
 file.

        <nobr>

            boolean</nobr>

        <nobr>
        setWritable(boolean writable)</nobr>

Equivalent to setWritable(writable, true).

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

Returns a string containing a concise, human-readable description of this
 file.

        <nobr>

            URI</nobr>

        <nobr>
        toURI()</nobr>

Returns a Uniform Resource Identifier for this file.

        <nobr>

            URL</nobr>

        <nobr>
        toURL()</nobr>

      This method was deprecated
      in API level 9.
    Use toURI() and toURL() to
 correctly escape illegal characters.

  [Expand]

Inherited Methods

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

Creates and returns a copy of this Object.

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object o)</nobr>

Compares this instance with the specified object and indicates if they
 are equal.

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

Invoked when the garbage collector has detected that this instance is no longer reachable.

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

Returns the unique instance of Class that represents this
 object's class.

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

Returns an integer hash code for this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

Causes a thread which is waiting on this object's monitor (by means of
 calling one of the wait() methods) to be woken up.

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

Causes all threads which are waiting on this object's monitor (by means
 of calling one of the wait() methods) to be woken up.

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

Returns a string containing a concise, human-readable description of this
 object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis, int nanos)</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long millis)</nobr>

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
 specified timeout expires.

From interface

  java.lang.Comparable

        <nobr>
            abstract

            int</nobr>

        <nobr>
        compareTo(T another)</nobr>

Compares this object to the specified object to determine their relative
 order.

Fields

        public
        static
        final
        String

        pathSeparator

  Added in API level 1

The system-dependent string used to separate components in search paths (":").
 See pathSeparatorChar.

        public
        static
        final
        char

        pathSeparatorChar

  Added in API level 1

The system-dependent character used to separate components in search paths (':').
 This is used to split such things as the PATH environment variable and classpath
 system properties into lists of directories to be searched.

This field is initialized from the system property "path.separator".
 Later changes to that property will have no effect on this field or this class.

        public
        static
        final
        String

        separator

  Added in API level 1

The system-dependent string used to separate components in filenames ('/').
 See separatorChar.

        public
        static
        final
        char

        separatorChar

  Added in API level 1

The system-dependent character used to separate components in filenames ('/').
 Use of this (rather than hard-coding '/') helps portability to other operating systems.

This field is initialized from the system property "file.separator".
 Later changes to that property will have no effect on this field or this class.

Public Constructors

        public

      File
      (File dir, String name)

  Added in API level 1

Constructs a new file using the specified directory and name.

Parameters

          dir
          the directory where the file is stored.

          name
          the file's name.

Throws

            NullPointerException
            if name is null.

        public

      File
      (String path)

  Added in API level 1

Constructs a new file using the specified path.

Parameters

          path
          the path to be used for the file.

        public

      File
      (String dirPath, String name)

  Added in API level 1

Constructs a new File using the specified directory path and file name,
 placing a path separator between the two.

Parameters

          dirPath
          the path to the directory where the file is stored.

          name
          the file's name.

Throws

            NullPointerException
            if name == null.

        public

      File
      (URI uri)

  Added in API level 1

Constructs a new File using the path of the specified URI. uri
 needs to be an absolute and hierarchical Unified Resource Identifier with
 file scheme and non-empty path component, but with undefined authority,
 query or fragment components.

Parameters

          uri
          the Unified Resource Identifier that is used to construct this
            file.

Throws

            IllegalArgumentException
            if uri does not comply with the conditions above.

See Also

toURI()

URI

Public Methods

        public

        boolean

      canExecute
      ()

  Added in API level 9

Tests whether or not this process is allowed to execute this file.
 Note that this is a best-effort result; the only way to be certain is
 to actually attempt the operation.

Returns

true if this file can be executed, false otherwise.

        public

        boolean

      canRead
      ()

  Added in API level 1

Indicates whether the current context is allowed to read from this file.

Returns

true if this file can be read, false otherwise.

        public

        boolean

      canWrite
      ()

  Added in API level 1

Indicates whether the current context is allowed to write to this file.

Returns

true if this file can be written, false
         otherwise.

        public

        int

      compareTo
      (File another)

  Added in API level 1

Returns the relative sort ordering of the paths for this file and the
 file another. The ordering is platform dependent.

Parameters

          another
          a file to compare this file to

Returns

an int determined by comparing the two paths. Possible values are
         described in the Comparable interface.

See Also

Comparable

        public

        boolean

      createNewFile
      ()

  Added in API level 1

Creates a new, empty file on the file system according to the path
 information stored in this file. This method returns true if it creates
 a file, false if the file already existed. Note that it returns false
 even if the file is not a file (because it's a directory, say).

This method is not generally useful. For creating temporary files,
 use createTempFile(String, String) instead. For reading/writing files, use FileInputStream,
 FileOutputStream, or RandomAccessFile, all of which can create files.

Note that this method does not throw IOException if the file
 already exists, even if it's not a regular file. Callers should always check the
 return value, and may additionally want to call isFile().

Returns

true if the file has been created, false if it
         already exists.

Throws

            IOException
            if it's not possible to create the file.

        public
        static

        File

      createTempFile
      (String prefix, String suffix, File directory)

  Added in API level 1

Creates an empty temporary file in the given directory using the given
 prefix and suffix as part of the file name. If suffix is null, .tmp is used.

Note that this method does not call deleteOnExit(), but see the
 documentation for that method before you call it manually.

Parameters

          prefix
          the prefix to the temp file name.

          suffix
          the suffix to the temp file name.

          directory
          the location to which the temp file is to be written, or
            null for the default location for temporary files,
            which is taken from the "java.io.tmpdir" system property. It
            may be necessary to set this property to an existing, writable
            directory for this method to work properly.

Returns

the temporary file.

Throws

            IllegalArgumentException
            if the length of prefix is less than 3.

            IOException
            if an error occurs when writing the file.

        public
        static

        File

      createTempFile
      (String prefix, String suffix)

  Added in API level 1

Creates an empty temporary file using the given prefix and suffix as part
 of the file name. If suffix is null, .tmp is used. This
 method is a convenience method that calls
 createTempFile(String, String, File) with the third argument
 being null.

Parameters

          prefix
          the prefix to the temp file name.

          suffix
          the suffix to the temp file name.

Returns

the temporary file.

Throws

            IOException
            if an error occurs when writing the file.

        public

        boolean

      delete
      ()

  Added in API level 1

Deletes this file. Directories must be empty before they will be deleted.

Note that this method does not throw IOException on failure.
 Callers must check the return value.

Returns

true if this file was deleted, false otherwise.

        public

        void

      deleteOnExit
      ()

  Added in API level 1

Schedules this file to be automatically deleted when the VM terminates normally.

Note that on Android, the application lifecycle does not include VM termination,
 so calling this method will not ensure that files are deleted. Instead, you should
 use the most appropriate out of:

Use a finally clause to manually invoke delete().

Maintain your own set of files to delete, and process it at an appropriate point
 in your application's lifecycle.

Use the Unix trick of deleting the file as soon as all readers and writers have
 opened it. No new readers/writers will be able to access the file, but all existing
 ones will still have access until the last one closes the file.

        public

        boolean

      equals
      (Object obj)

  Added in API level 1

Compares obj to this file and returns true if they
 represent the same object using a path specific comparison.

Parameters

          obj
          the object to compare this file with.

Returns

true if obj is the same as this object,
         false otherwise.

        public

        boolean

      exists
      ()

  Added in API level 1

Returns a boolean indicating whether this file can be found on the
 underlying file system.

Returns

true if this file exists, false otherwise.

        public

        File

      getAbsoluteFile
      ()

  Added in API level 1

Returns a new file constructed using the absolute path of this file.
 Equivalent to new File(this.getAbsolutePath()).

        public

        String

      getAbsolutePath
      ()

  Added in API level 1

Returns the absolute path of this file. An absolute path is a path that starts at a root
 of the file system. On Android, there is only one root: /.

A common use for absolute paths is when passing paths to a Process as
 command-line arguments, to remove the requirement implied by relative paths, that the
 child must have the same working directory as its parent.

        public

        File

      getCanonicalFile
      ()

  Added in API level 1

Returns a new file created using the canonical path of this file.
 Equivalent to new File(this.getCanonicalPath()).

Returns

the new file constructed from this file's canonical path.

Throws

            IOException
            if an I/O error occurs.

        public

        String

      getCanonicalPath
      ()

  Added in API level 1

Returns the canonical path of this file.
 An absolute path is one that begins at the root of the file system.
 A canonical path is an absolute path with symbolic links
 and references to "." or ".." resolved. If a path element does not exist (or
 is not searchable), there is a conflict between interpreting canonicalization
 as a textual operation (where "a/../b" is "b" even if "a" does not exist) .

Most callers should use getAbsolutePath() instead. A canonical path is
 significantly more expensive to compute, and not generally useful. The primary
 use for canonical paths is determining whether two paths point to the same file by
 comparing the canonicalized paths.

It can be actively harmful to use a canonical path, specifically because
 canonicalization removes symbolic links. It's wise to assume that a symbolic link
 is present for a reason, and that that reason is because the link may need to change.
 Canonicalization removes this layer of indirection. Good code should generally avoid
 caching canonical paths.

Returns

the canonical path of this file.

Throws

            IOException
            if an I/O error occurs.

        public

        long

      getFreeSpace
      ()

  Added in API level 9

Returns the number of free bytes on the partition containing this path.
 Returns 0 if this path does not exist.

Note that this is likely to be an optimistic over-estimate and should not
 be taken as a guarantee your application can actually write this many bytes.

        public

        String

      getName
      ()

  Added in API level 1

Returns the name of the file or directory represented by this file.

Returns

this file's name or an empty string if there is no name part in
         the file's path.

        public

        String

      getParent
      ()

  Added in API level 1

Returns the pathname of the parent of this file. This is the path up to
 but not including the last name. null is returned if there is no
 parent.

Returns

this file's parent pathname or null.

        public

        File

      getParentFile
      ()

  Added in API level 1

Returns a new file made from the pathname of the parent of this file.
 This is the path up to but not including the last name. null is
 returned when there is no parent.

Returns

a new file representing this file's parent or null.

        public

        String

      getPath
      ()

  Added in API level 1

Returns the path of this file.

        public

        long

      getTotalSpace
      ()

  Added in API level 9

Returns the total size in bytes of the partition containing this path.
 Returns 0 if this path does not exist.

        public

        long

      getUsableSpace
      ()

  Added in API level 9

Returns the number of usable free bytes on the partition containing this path.
 Returns 0 if this path does not exist.

Note that this is likely to be an optimistic over-estimate and should not
 be taken as a guarantee your application can actually write this many bytes.
 On Android (and other Unix-based systems), this method returns the number of free bytes
 available to non-root users, regardless of whether you're actually running as root,
 and regardless of any quota or other restrictions that might apply to the user.
 (The getFreeSpace method returns the number of bytes potentially available to root.)

        public

        int

      hashCode
      ()

  Added in API level 1

Returns an integer hash code for the receiver. Any two objects for which
 equals returns true must return the same hash code.

Returns

this files's hash value.

See Also

equals(Object)

        public

        boolean

      isAbsolute
      ()

  Added in API level 1

Indicates if this file's pathname is absolute. Whether a pathname is
 absolute is platform specific. On Android, absolute paths start with
 the character '/'.

Returns

true if this file's pathname is absolute, false
         otherwise.

See Also

getPath()

        public

        boolean

      isDirectory
      ()

  Added in API level 1

Indicates if this file represents a directory on the
 underlying file system.

Returns

true if this file is a directory, false
         otherwise.

        public

        boolean

      isFile
      ()

  Added in API level 1

Indicates if this file represents a file on the underlying
 file system.

Returns

true if this file is a file, false otherwise.

        public

        boolean

      isHidden
      ()

  Added in API level 1

Returns whether or not this file is a hidden file as defined by the
 operating system. The notion of "hidden" is system-dependent. For Unix
 systems a file is considered hidden if its name starts with a ".". For
 Windows systems there is an explicit flag in the file system for this
 purpose.

Returns

true if the file is hidden, false otherwise.

        public

        long

      lastModified
      ()

  Added in API level 1

Returns the time when this file was last modified, measured in
 milliseconds since January 1st, 1970, midnight.
 Returns 0 if the file does not exist.

Returns

the time when this file was last modified.

        public

        long

      length
      ()

  Added in API level 1

Returns the length of this file in bytes.
 Returns 0 if the file does not exist.
 The result for a directory is not defined.

Returns

the number of bytes in this file.

        public

        String[]

      list
      ()

  Added in API level 1

Returns an array of strings with the file names in the directory
 represented by this file. The result is null if this file is not
 a directory.

 The entries . and .. representing the current and parent
 directory are not returned as part of the list.

Returns

an array of strings with file names or null.

        public

        String[]

      list
      (FilenameFilter filter)

  Added in API level 1

Gets a list of the files in the directory represented by this file. This
 list is then filtered through a FilenameFilter and the names of files
 with matching names are returned as an array of strings. Returns
 null if this file is not a directory. If filter is
 null then all filenames match.

 The entries . and .. representing the current and parent
 directories are not returned as part of the list.

Parameters

          filter
          the filter to match names against, may be null.

Returns

an array of files or null.

        public

        File[]

      listFiles
      ()

  Added in API level 1

Returns an array of files contained in the directory represented by this
 file. The result is null if this file is not a directory. The
 paths of the files in the array are absolute if the path of this file is
 absolute, they are relative otherwise.

Returns

an array of files or null.

        public

        File[]

      listFiles
      (FilenameFilter filter)

  Added in API level 1

Gets a list of the files in the directory represented by this file. This
 list is then filtered through a FilenameFilter and files with matching
 names are returned as an array of files. Returns null if this
 file is not a directory. If filter is null then all
 filenames match.

 The entries . and .. representing the current and parent
 directories are not returned as part of the list.

Parameters

          filter
          the filter to match names against, may be null.

Returns

an array of files or null.

        public

        File[]

      listFiles
      (FileFilter filter)

  Added in API level 1

Gets a list of the files in the directory represented by this file. This
 list is then filtered through a FileFilter and matching files are
 returned as an array of files. Returns null if this file is not a
 directory. If filter is null then all files match.

 The entries . and .. representing the current and parent
 directories are not returned as part of the list.

Parameters

          filter
          the filter to match names against, may be null.

Returns

an array of files or null.

        public
        static

        File[]

      listRoots
      ()

  Added in API level 1

Returns the file system roots. On Android and other Unix systems, there is
 a single root, /.

        public

        boolean

      mkdir
      ()

  Added in API level 1

Creates the directory named by this file, assuming its parents exist.
 Use mkdirs() if you also want to create missing parents.

Note that this method does not throw IOException on failure.
 Callers must check the return value. Note also that this method returns
 false if the directory already existed. If you want to know whether the
 directory exists on return, either use (f.mkdir() || f.isDirectory())
 or simply ignore the return value from this method and simply call isDirectory().

Returns

true if the directory was created,
         false on failure or if the directory already existed.

        public

        boolean

      mkdirs
      ()

  Added in API level 1

Creates the directory named by this file, creating missing parent
 directories if necessary.
 Use mkdir() if you don't want to create missing parents.

Note that this method does not throw IOException on failure.
 Callers must check the return value. Note also that this method returns
 false if the directory already existed. If you want to know whether the
 directory exists on return, either use (f.mkdirs() || f.isDirectory())
 or simply ignore the return value from this method and simply call isDirectory().

Returns

true if the directory was created,
         false on failure or if the directory already existed.

        public

        boolean

      renameTo
      (File newPath)

  Added in API level 1

Renames this file to newPath. This operation is supported for both
 files and directories.

Many failures are possible. Some of the more likely failures include:

Write permission is required on the directories containing both the source and
 destination paths.

Search permission is required for all parents of both paths.

Both paths be on the same mount point. On Android, applications are most likely to hit
 this restriction when attempting to copy between internal storage and an SD card.

Note that this method does not throw IOException on failure.
 Callers must check the return value.

Parameters

          newPath
          the new path.

Returns

true on success.

        public

        boolean

      setExecutable
      (boolean executable)

  Added in API level 9

Equivalent to setExecutable(executable, true).

See Also

setExecutable(boolean, boolean)

        public

        boolean

      setExecutable
      (boolean executable, boolean ownerOnly)

  Added in API level 9

Manipulates the execute permissions for the abstract path designated by
 this file.

Note that this method does not throw IOException on failure.
 Callers must check the return value.

Parameters

          executable
          To allow execute permission if true, otherwise disallow

          ownerOnly
          To manipulate execute permission only for owner if true,
            otherwise for everyone. The manipulation will apply to
            everyone regardless of this value if the underlying system
            does not distinguish owner and other users.

Returns

true if and only if the operation succeeded. If the user does not
         have permission to change the access permissions of this abstract
         pathname the operation will fail. If the underlying file system
         does not support execute permission and the value of executable
         is false, this operation will fail.

        public

        boolean

      setLastModified
      (long time)

  Added in API level 1

Sets the time this file was last modified, measured in milliseconds since
 January 1st, 1970, midnight.

Note that this method does not throw IOException on failure.
 Callers must check the return value.

Parameters

          time
          the last modification time for this file.

Returns

true if the operation is successful, false
         otherwise.

Throws

            IllegalArgumentException
            if time < 0.

        public

        boolean

      setReadOnly
      ()

  Added in API level 1

Equivalent to setWritable(false, false).

See Also

setWritable(boolean, boolean)

        public

        boolean

      setReadable
      (boolean readable)

  Added in API level 9

Equivalent to setReadable(readable, true).

See Also

setReadable(boolean, boolean)

        public

        boolean

      setReadable
      (boolean readable, boolean ownerOnly)

  Added in API level 9

Manipulates the read permissions for the abstract path designated by this
 file.

Parameters

          readable
          To allow read permission if true, otherwise disallow

          ownerOnly
          To manipulate read permission only for owner if true,
            otherwise for everyone. The manipulation will apply to
            everyone regardless of this value if the underlying system
            does not distinguish owner and other users.

Returns

true if and only if the operation succeeded. If the user does not
         have permission to change the access permissions of this abstract
         pathname the operation will fail. If the underlying file system
         does not support read permission and the value of readable is
         false, this operation will fail.

        public

        boolean

      setWritable
      (boolean writable, boolean ownerOnly)

  Added in API level 9

Manipulates the write permissions for the abstract path designated by this
 file.

Parameters

          writable
          To allow write permission if true, otherwise disallow

          ownerOnly
          To manipulate write permission only for owner if true,
            otherwise for everyone. The manipulation will apply to
            everyone regardless of this value if the underlying system
            does not distinguish owner and other users.

Returns

true if and only if the operation succeeded. If the user does not
         have permission to change the access permissions of this abstract
         pathname the operation will fail.

        public

        boolean

      setWritable
      (boolean writable)

  Added in API level 9

Equivalent to setWritable(writable, true).

See Also

setWritable(boolean, boolean)

        public

        String

      toString
      ()

  Added in API level 1

Returns a string containing a concise, human-readable description of this
 file.

Returns

a printable representation of this file.

        public

        URI

      toURI
      ()

  Added in API level 1

Returns a Uniform Resource Identifier for this file. The URI is system
 dependent and may not be transferable between different operating / file
 systems.

Returns

an URI for this file.

        public

        URL

      toURL
      ()

  Added in API level 1

      This method was deprecated
      in API level 9.

    Use toURI() and toURL() to
 correctly escape illegal characters.

Returns a Uniform Resource Locator for this file. The URL is system
 dependent and may not be transferable between different operating / file
 systems.

Returns

a URL for this file.

Throws

            MalformedURLException
            if the path cannot be transformed into a URL.

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android 4.4 r1 —

    About Android  |
    Legal  |
    Support


text:
The `Analytics` class from the `mapbox.services.analytics` module provides
access to the Mapbox Analytics API. You can also import it directly from the
`mapbox` module.

**Note**: This API is available only for premium and enterprise plans.

```python
>>> from mapbox import Analytics

```

See https://www.mapbox.com/api-documentation/accounts/#analytics for general documentation of the API.

Your Mapbox access token should be set in your environment; see the [access
tokens](access_tokens.md) documentation for more information.

## Analytics methods

The methods of `Analytics` class that provide access to the Analytics API return an instance of
[`requests.Response`](http://docs.python-requests.org/en/latest/api/#requests.Response). `Analytics` response also include the `json()` method which returns Python data parsed from API.

## Usage

The Mapbox Analytics API is used to get API usage for services by resource. It returns counts per day for given resource and period.

```python
>>> analytics = Analytics()

```

The input to `analytics` method are resource_type, username, id, period, access_token.

```python
>>> response = analytics.analytics('accounts', 'mapbox-sdk-py-user')
>>> response.status_code
200

```


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Lines, Shapes, and Shadows</title>

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>

    <link href="vendor/magnific-popup/magnific-popup.css" rel="stylesheet">

    <link href="css/creative.min.css" rel="stylesheet">

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation Menu
                </button>
                Anna Butakova

Lines, Shapes, and Shadows

Lines

It is very important for any designer to understand the principles of lines. Lines are very common elements of graphic design. We use lines for organization, connection, and separatation of all information and design elements. .

 Diagonal Lines: are lines that straight in any direction except vertical or horizontal. Usually they create a sense of movement, energy and power.

 Horizontal Lines: are straight up and down and perpendicular to vertical lines. Usually they provide the texture of design.

 Curvy Lines: are lines that are smooth and make people feel more relaxed and safe.

 Jagged Lines: are lines that create a sense of danger or frequency.

 Lines that have 90-degree Angles: are lines that make people feel sharpness and mechanical.

 Lines with Curves: are lines that associate with expressiveness

Shapes

Shapes in design are a basic element. They are made up of closed contours and three dimensional objects placed in the design. Usually, shapes are used to convey meaning and organize information.

 Geometric shapes: are the default shapes provided in any image-creating program.

 Freeform shapes: are more abstract and consist of random angles, irregular lines and do no have any geometric lines/forms.

Rounded corners make the look of the webpage is soft and smooth, so, the viewer can feel organic approach. Also, rotation was created to help to do the same effect like diagonal lines have (movement, energy, and power).

Shadows

Using shadows helps to give a very unique feeling of depth and volume to every single object. Shadows, in general, create a visual contrast and make a two-dimensional image look three-dimensional.

THANK YOU!

I hope you like my Color Theory!


text:
package org.web3j.mavenplugin;

import com.fasterxml.jackson.core.TreeNode;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.shared.model.fileset.FileSet;
import org.apache.maven.shared.model.fileset.util.FileSetManager;
import org.web3j.abi.datatypes.Address;
import org.web3j.codegen.SolidityFunctionWrapper;
import org.web3j.mavenplugin.solidity.CompilerResult;
import org.web3j.mavenplugin.solidity.SolidityCompiler;
import org.web3j.mavenplugin.solidity.SolidityCompiler.Options;
import org.web3j.protocol.ObjectMapperFactory;
import org.web3j.protocol.core.methods.response.AbiDefinition;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Maven Plugin to generate the java classes out of the solidity contract files.
 */
@Mojo(name = "generate-sources",
        defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
public class JavaClassGeneratorMojo extends AbstractMojo {

    private static final String DEFAULT_SOLIDITY_INCLUDE = "**/*.sol";
    private static final String DEFAULT_ABI_INCLUDE = "**/*.json";
    private static final String DEFAULT_PACKAGE = "org.web3j.model";
    private static final String DEFAULT_SOURCE_DESTINATION = "src/main/java";
    private static final String DEFAULT_SOLIDITY_SOURCES = "src/main/resources";
    private static final String DEFAULT_ABI_SOURCES = "src/main/resources";
    private static final String DEFAULT_OUTPUT_FORMAT = "java";

    @Parameter(property = "packageName", defaultValue = DEFAULT_PACKAGE)
    protected String packageName;

    @Parameter(property = "sourceDestination", defaultValue = DEFAULT_SOURCE_DESTINATION)
    protected String sourceDestination;

    @Parameter(property = "outputDirectory")
    protected SourceDestination outputDirectory = new SourceDestination();

    @Parameter(property = "soliditySourceFiles")
    protected FileSet soliditySourceFiles = new FileSet();

    @Parameter(property = "abiSourceFiles")
    protected FileSet abiSourceFiles = new FileSet();

    @Parameter(property = "contract")
    protected Contract contract;

    @Parameter(property = "nativeJavaType", defaultValue = "true")
    protected boolean nativeJavaType;

    @Parameter(property = "pathPrefixes")
    protected String[] pathPrefixes = new String[0];

    @Parameter(property = "outputFormat", defaultValue = DEFAULT_OUTPUT_FORMAT)
    protected String outputFormat;

    @Parameter(property = "outputJavaParentContractClassName")
    protected String outputJavaParentContractClassName;

    private Path createPath(String destinationPath) throws IOException {
        Path path = Paths.get(destinationPath, packageName);

        if (!path.toFile().exists()) {
            Files.createDirectories(path);
        }
        return path;
    }

    private Map<String, Map<String, String>> extractContracts(String result) throws MojoExecutionException {
        JsonParser jsonParser = new JsonParser();
        Map<String, Object> json = jsonParser.parseJson(result);
        Map<String, Map<String, String>> contracts = (Map<String, Map<String, String>>) json.get("contracts");
        if (contracts == null) {
            getLog().warn("no contracts found");
            return null;
        }
        Map<String, String> contractRemap = new HashMap<>();

        HashSet<String> contractsKeys = new HashSet<>(contracts.keySet());
        for (String contractFilename : contractsKeys) {
            Map<String, String> contractMetadata = contracts.get(contractFilename);

            String metadata = contractMetadata.get("metadata");
            if (metadata == null || metadata.length() == 0) {
                contracts.remove(contractFilename);
                continue;
            }
            getLog().debug("metadata:" + metadata);
            Map<String, Object> metadataJson = jsonParser.parseJson(metadata);
            Object settingsMap = metadataJson.get("settings");
            if (settingsMap != null) {
                Map<String, String> compilationTarget = ((Map<String, Map<String, String>>) settingsMap).get("compilationTarget");
                if (compilationTarget != null) {
                    for (Map.Entry<String, String> entry : compilationTarget.entrySet()) {
                        String value = entry.getValue();
                        contractRemap.put(contractFilename, value);
                    }
                }
            }
            Map<String, String> compiledContract = contracts.remove(contractFilename);
            /**
             * From solidity 0.8.0 the property "abi" for the option "combined-json" is an Object instead a String.
             * https://docs.soliditylang.org/en/v0.8.0/080-breaking-changes.html?highlight=combined-json
             */
            final Object abi = compiledContract.get("abi");
            compiledContract.put("abi", abi.toString());
            String contractName = contractRemap.get(contractFilename);
            contracts.put(contractName, compiledContract);
        }
        return contracts;
    }

    private void generatedJavaClass(Map<String, String> results, String contractName) throws IOException, ClassNotFoundException {
        if (!StringUtils.containsIgnoreCase(outputFormat, "java")) {
            return;
        }
        List<AbiDefinition> functionDefinitions = loadContractDefinition(results.get(SolidityCompiler.Options.ABI.getName()));
        generatedJavaClass(contractName, functionDefinitions, results.get(SolidityCompiler.Options.BIN.getName()));
    }

    private void generatedJavaClass(String contractName, List<AbiDefinition> functionDefinitions, String bin) throws IOException, ClassNotFoundException {
        int addressLength = Address.DEFAULT_LENGTH / Byte.SIZE;
        boolean primitiveTypes = false;

        if (functionDefinitions.isEmpty()) {
            getLog().warn("Unable to parse input ABI file");
            return;
        }

        Class<? extends org.web3j.tx.Contract> contractClass = outputJavaParentContractClassName == null
                ? org.web3j.tx.Contract.class
                : (Class<? extends org.web3j.tx.Contract>) Class.forName(outputJavaParentContractClassName);
        new SolidityFunctionWrapper(
                nativeJavaType,
                primitiveTypes,
                false, //generateSendTxForCalls
                addressLength)
                .generateJavaFiles(
                        contractClass,
                        contractName,
                        bin,
                        functionDefinitions,
                        StringUtils.defaultString(outputDirectory.getJava(), sourceDestination),
                        packageName,
                        null

                );
    }

    private void processSolidityFile(Collection<String> files) throws MojoExecutionException {
        String result = parseSoliditySources(files);
        processResult(result, "\tNo Solidity сontract found in files '" + files + "'");
    }

    public void processAbiFile(Collection<String> fileNames) throws IOException, ClassNotFoundException {
        for (String fileName : fileNames) {
            File file = Paths.get(abiSourceFiles.getDirectory(), fileName).toFile();
            generatedJavaClass(FilenameUtils.removeExtension(file.getName()), FileUtils.readFileToString(file));
        }
    }

    private void generatedJavaClass(String contractName, String fileContent) throws IOException, ClassNotFoundException {
        Map<String, String> results = parseAbiFile(fileContent);

        List<AbiDefinition> functionDefinitions = loadContractDefinition(results.get(SolidityCompiler.Options.ABI.getName()));
        if(!functionDefinitions.isEmpty()) {
            generatedJavaClass(contractName, functionDefinitions, results.get(SolidityCompiler.Options.BIN.getName()));
        } else {
            getLog().warn("Ignoring input abi file for contract \"" + contractName + "\". " +
                              "ABI Definition is empty.");
        }
    }

    private Map<String, String> parseAbiFile(String fileContent) throws IOException {
        Map<String, String> results = new HashMap<>();

        ObjectMapper objectMapper = ObjectMapperFactory.getObjectMapper();
        JsonNode abiData = objectMapper.readTree(fileContent);

        if(abiData.isObject() && abiData.has("abi") && abiData.has("bytecode")) {
            // truffle or hardhat artifact
            results.put(SolidityCompiler.Options.BIN.getName(), abiData.get("bytecode").asText());
            results.put(SolidityCompiler.Options.ABI.getName(), objectMapper.writeValueAsString(abiData.get("abi")));
        } else {
            results.put(Options.BIN.getName(), "Bin file was not provided");
            results.put(SolidityCompiler.Options.ABI.getName(), fileContent);
        }

        return results;
    }

    public void execute() throws MojoExecutionException {
        processSolidityFiles();
        processAbiFiles();
    }

    private void processSolidityFiles() throws MojoExecutionException {
        if (soliditySourceFiles.getDirectory() == null) {
            getLog().info("No Solidity directory specified, using default directory [" + DEFAULT_SOLIDITY_SOURCES + "]");
            soliditySourceFiles.setDirectory(DEFAULT_SOLIDITY_SOURCES);
        }
        if (soliditySourceFiles.getIncludes().isEmpty()) {
            getLog().info("No Solidity contracts specified, using the default [" + DEFAULT_SOLIDITY_INCLUDE + "]");
            soliditySourceFiles.setIncludes(Collections.singletonList(DEFAULT_SOLIDITY_INCLUDE));
        }

        String[] files = new FileSetManager().getIncludedFiles(soliditySourceFiles);
        if (files != null) {
            processSolidityFile(Stream.of(files)
                    .filter(f -> {
                        getLog().info("Solidity: adding to process '" + f + "'");
                        return true;
                    })
                    .collect(Collectors.toList()));
        }
    }

    private void processAbiFiles() throws MojoExecutionException {
        if (abiSourceFiles.getDirectory() == null) {
            getLog().info("No abiSourceFiles directory specified, using default directory [" + DEFAULT_ABI_SOURCES + "]");
            abiSourceFiles.setDirectory(DEFAULT_ABI_SOURCES);
        }
        if (abiSourceFiles.getIncludes().isEmpty()) {
            getLog().info("No abiSourceFiles contracts specified, using the default [" + DEFAULT_ABI_INCLUDE + "]");
            abiSourceFiles.setIncludes(Collections.singletonList(DEFAULT_ABI_INCLUDE));
        }
        String[] abiFiles = new FileSetManager().getIncludedFiles(abiSourceFiles);
        if (abiFiles != null) {
            try {
                processAbiFile(Stream.of(abiFiles)
                        .peek(it -> getLog().info("Abi: adding to process '" + it + "'"))
                        .collect(Collectors.toList()));
            } catch (IOException | ClassNotFoundException e) {
                getLog().error(e);
                throw new MojoExecutionException("Error during abi source files processing", e);
            }
        }
    }

    private void generatedAbi(Map<String, String> contractResult, String contractName) {
        if (!StringUtils.containsIgnoreCase(outputFormat, "abi")) {
            return;
        }

        String abiJson = contractResult.get(SolidityCompiler.Options.ABI.getName());
        try {
            String filename = contractName + ".json";
            Path path = createPath(StringUtils.defaultString(outputDirectory.getAbi(), sourceDestination));
            Files.write(Paths.get(path.toString(), filename), abiJson.getBytes());
        } catch (IOException e) {
            getLog().error("Could not build abi file for contract '" + contractName + "'", e);
        }
    }

    private void generatedBin(Map<String, String> contractResult, String contractName) {
        if (!StringUtils.containsIgnoreCase(outputFormat, "bin")) {
            return;
        }

        String binJson = contractResult.get(SolidityCompiler.Options.BIN.getName());
        try {
            String filename = contractName + ".bin";
            Path path = createPath(StringUtils.defaultString(outputDirectory.getBin(), sourceDestination));

            Files.write(Paths.get(path.toString(), filename), binJson.getBytes());
        } catch (IOException e) {
            getLog().error("Could not build bin file for contract '" + contractName + "'", e);
        }
    }

    protected List<AbiDefinition> loadContractDefinition(String abiFile) throws IOException {
        ObjectMapper objectMapper = ObjectMapperFactory.getObjectMapper();
        AbiDefinition[] abiDefinition = objectMapper.readValue(abiFile, AbiDefinition[].class);
        return Arrays.asList(abiDefinition);
    }

    private String parseSoliditySources(Collection<String> includedFiles) throws MojoExecutionException {
        if (includedFiles.isEmpty()) {
            return "{}";
        }
        CompilerResult result = SolidityCompiler.getInstance(getLog()).compileSrc(
                soliditySourceFiles.getDirectory(),
                includedFiles,
                pathPrefixes,
                SolidityCompiler.Options.ABI,
                SolidityCompiler.Options.BIN,
                SolidityCompiler.Options.METADATA
        );
        if (result.isFailed()) {
            throw new MojoExecutionException("Could not compile Solidity files\n" + result.errors);
        }

        getLog().debug("\t\tResult:\t" + result.output);
        if (result.errors.contains("Warning:")) {
            getLog().info("\tCompile Warning:\n" + result.errors);
        } else {
            getLog().debug("\t\tError: \t" + result.errors);
        }
        return result.output;
    }

    private void processResult(String result, String warnMsg) throws MojoExecutionException {
        Map<String, Map<String, String>> contracts = extractContracts(result);
        if (contracts == null) {
            getLog().warn(warnMsg);
            return;
        }
        for (Map.Entry<String, Map<String, String>> entry : contracts.entrySet()) {
            String contractName = entry.getKey();
            if (isFiltered(contractName)) {
                getLog().debug("\tContract '" + contractName + "' is filtered");
                continue;
            }
            try {
                Map<String, String> contractResult = entry.getValue();
                generatedJavaClass(contractResult, contractName);
                generatedAbi(contractResult, contractName);
                generatedBin(contractResult, contractName);
                getLog().info("\tBuilt Class for contract '" + contractName + "'");
            } catch (ClassNotFoundException | IOException ioException) {
                getLog().error("Could not build java class for contract '" + contractName + "'", ioException);
            }
        }
    }

    private boolean isFiltered(String contractName) {
        if (contract == null) {
            return false;
        }

        if (contract.getExcludes() != null && !contract.getExcludes().isEmpty()) {
            return contract.getExcludes().contains(contractName);
        }

        if (contract.getIncludes() == null || contract.getIncludes().isEmpty()) {
            return false;
        } else {
            return !contract.getIncludes().contains(contractName);
        }
    }
}


text:
using System.Text.Json;
using Azure;
using Azure.Core;
using Azure.ResourceManager.Network.Models;

namespace Azure.ResourceManager.Network
{
    public partial class BgpConnectionData : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Optional.IsDefined(Id))
            {
                writer.WritePropertyName("id");
                writer.WriteStringValue(Id);
            }
            if (Optional.IsDefined(Name))
            {
                writer.WritePropertyName("name");
                writer.WriteStringValue(Name);
            }
            writer.WritePropertyName("properties");
            writer.WriteStartObject();
            if (Optional.IsDefined(PeerAsn))
            {
                writer.WritePropertyName("peerAsn");
                writer.WriteNumberValue(PeerAsn.Value);
            }
            if (Optional.IsDefined(PeerIP))
            {
                writer.WritePropertyName("peerIp");
                writer.WriteStringValue(PeerIP);
            }
            writer.WriteEndObject();
            writer.WriteEndObject();
        }

        internal static BgpConnectionData DeserializeBgpConnectionData(JsonElement element)
        {
            Optional<ETag> etag = default;
            Optional<ResourceIdentifier> id = default;
            Optional<string> name = default;
            Optional<ResourceType> type = default;
            Optional<long> peerAsn = default;
            Optional<string> peerIP = default;
            Optional<NetworkProvisioningState> provisioningState = default;
            Optional<HubBgpConnectionStatus> connectionState = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    etag = new ETag(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("peerAsn"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            peerAsn = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("peerIp"))
                        {
                            peerIP = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new NetworkProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("connectionState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            connectionState = new HubBgpConnectionStatus(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return new BgpConnectionData(id.Value, name.Value, Optional.ToNullable(type), Optional.ToNullable(etag), Optional.ToNullable(peerAsn), peerIP.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(connectionState));
        }
    }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _Expectation = require('./Expectation');

var _Expectation2 = _interopRequireDefault(_Expectation);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Extensions = [];

function extend(extension) {
  if (Extensions.indexOf(extension) === -1) {
    Extensions.push(extension);

    for (var p in extension) {
      if (extension.hasOwnProperty(p)) _Expectation2.default.prototype[p] = extension[p];
    }
  }
}

exports.default = extend;