file-operator
v1.1.11
Published
Read and write to files asynchronously
Downloads
3
Readme
��#� �f�i�l�e�-�o�p�e�r�a�t�o�r�
�
�<�p�r�e�>�<�c�o�d�e�>�n�p�m� �i� �f�i�l�e�-�o�p�e�r�a�t�o�r�<�/�c�o�d�e�>�<�/�p�r�e�>�
�
�
�
��
��j�a�v�a�s�c�r�i�p�t�
�
�c�o�n�s�t� �F�i�l�e�O�p�e�r�a�t�o�r� �=� �r�e�q�u�i�r�e�(�"�f�i�l�e�-�o�p�e�r�a�t�o�r�"�)�;�
�
�
��
�
�
�<�d�i�v�>�
�
� � � � �<�h�2�>�C�l�a�s�s�:� �<�c�o�d�e�>�F�i�l�e�O�p�e�r�a�t�o�r�<�/�c�o�d�e�>�<�/�h�2�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �T�h�e� �f�i�l�e�O�p�e�r�a�t�o�r� �o�f�f�e�r�s� �r�e�a�d�i�n�g� �a�n�d� �w�r�i�t�i�n�g� �t�o� �f�i�l�e�s� �a�s�y�n�c�h�r�o�n�o�u�s�l�y� �a�n�d� �o�f�f�e�r�s� �c�u�s�t�o�m�i�z�a�b�l�e� �s�t�r�i�n�g�i�f�y�i�n�g�-� �a�n�d� �p�a�r�s�i�n�g� �m�e�t�h�o�d�s�.� �T�h�e� �p�u�r�p�o�s�e� �i�s� �t�o� �r�e�a�d� �a�n�d� �s�a�v�e� �c�o�n�f�i�g�u�r�a�t�i�o�n�s� �f�i�l�e�s�.� �A�l�l� �a�s�y�n�c�h�r�o�n�o�u�s� �m�e�t�h�o�d�s� �c�a�n� �b�e� �i�n�v�o�k�e�d� �s�y�n�c�h�r�o�n�o�u�s�l�y� �b�e�c�a�u�s�e� �o�f� �a� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�w�w�w�.�n�p�m�j�s�.�c�o�m�/�p�a�c�k�a�g�e�/�c�a�1�1�b�a�c�k�-�q�u�e�u�e�"�>�C�a�l�l�b�a�c�k�Q�u�e�u�e�<�/�a�>�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�n�e�w� �F�i�l�e�O�p�e�r�a�t�o�r�(�f�i�l�e�p�a�t�h�)�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�u�l�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�f�i�l�e�p�a�t�h�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�D�a�t�a�_�s�t�r�u�c�t�u�r�e�s�#�S�t�r�i�n�g�_�t�y�p�e�"�>�&�l�t�;�s�t�r�i�n�g�&�g�t�;�<�/�a�>�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � �B�e�f�o�r�e� �c�r�e�a�t�i�n�g� �t�h�e� �f�i�l�e� �a�t� �f�i�l�e�p�a�t�h� �f�i�r�s�t� �r�e�c�u�r�s�i�v�e�l�y� �c�r�e�a�t�e�s� �d�i�r�e�c�t�o�r�i�e�s� �t�h�a�t� �d�o� �n�o�t� �e�x�i�s�t� �y�e�t�.�
�
� � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � �<�/�u�l�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �C�r�e�a�t�i�n�g� �t�h�e� �f�i�r�s�t� �f�i�l�e�O�p�e�r�a�t�o�r� �i�s� �a�n� �a�s�y�n�c�h�r�o�n�o�u�s� �o�p�e�r�a�t�i�o�n� �b�e�c�a�u�s�e� �t�h�e� �d�i�r�p�a�t�h� �m�u�s�t� �b�e� �c�r�e�a�t�e�d� �a�n�d� �t�h�e�n� �a� �f�i�l�e� �d�e�s�c�r�i�p�t�o�r� �m�u�s�t� �b�e� �o�p�e�n�e�d�.� �W�h�e�n� �o�p�e�n�i�n�g� �m�o�r�e� �t�h�a�n� �o�n�e� �F�i�l�e�O�p�e�r�a�t�o�r�s� �t�h�a�t� �h�a�v�e� �t�h�e� �s�a�m�e� �f�i�l�e�p�a�t�h� �t�h�e� �f�i�r�s�t� �f�i�l�e�O�p�e�r�a�t�o�r�s� �i�n�s�t�a�n�c�e� �i�s� �r�e�t�u�r�n�e�d� �a�n�d� �a� �c�e�r�t�a�i�n� �c�o�n�n�e�c�t�i�o�n�s� �c�o�u�n�t�e�r� �i�s� �i�n�c�r�e�m�e�n�t�e�d�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�f�i�l�e�O�p�e�r�a�t�o�r�.�&�#�3�6�;�r�e�a�d�(�o�v�e�r�w�r�i�t�e�)�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�u�l�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�o�v�e�r�w�r�i�t�e�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�D�a�t�a�_�s�t�r�u�c�t�u�r�e�s�#�b�o�o�l�e�a�n�_�t�y�p�e�"�>�&�l�t�;�b�o�o�l�e�a�n�&�g�t�;�<�/�a�>� �D�e�f�a�u�l�t�:� �<�c�o�d�e�>�f�a�l�s�e�<�/�c�o�d�e�>�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � �W�h�e�n� �o�v�e�r�w�r�i�t�e� �i�s� �<�c�o�d�e�>�t�r�u�e�<�/�c�o�d�e�>� �a�l�l� �p�r�o�p�e�r�t�i�e�s� �f�r�o�m� �f�i�l�e�O�p�e�r�a�t�o�r� �a�r�e� �o�v�e�r�w�r�i�t�t�e�n� �w�i�t�h� �t�h�e� �p�a�r�s�e�d� �o�b�j�e�c�t�'�s� �p�r�o�p�e�r�t�i�e�s�.� �W�h�e�n� �<�c�o�d�e�>�f�a�l�s�e�<�/�c�o�d�e�>� �t�h�e� �a�l�r�e�a�d�y� �d�e�f�i�n�e�d� �p�r�o�p�e�r�t�i�e�s� �o�f� �t�h�e� �f�i�l�e�O�p�e�r�a�t�o�r� �a�r�e� �a�r�e� �n�o�t� �o�v�e�r�w�r�i�t�t�e�n� �f�r�o�m� �t�h�e� �p�a�r�s�e�d� �o�b�j�e�c�t�.�
�
� � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � �<�/�u�l�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �R�e�a�d�i�n�g� �t�h�e� �c�o�n�t�e�n�t� �f�r�o�m� �t�h�e� �f�i�l�e� �i�s� �a�n� �a�s�y�n�c�h�r�o�n�o�u�s� �o�p�e�r�a�t�i�o�n�.� �T�h�e� �r�e�a�d� �c�o�n�t�e�n�t� �m�u�s�t� �b�e� �p�a�r�s�e�d� �i�n�t�o� �a�n� �o�b�j�e�c�t� �a�n�d� �t�h�e� �p�r�o�p�e�r�t�i�e�s� �c�o�p�i�e�d� �i�n�t�o� �t�h�e� �f�i�l�e�O�p�e�r�a�t�o�r�.� �I�f� �t�h�e� �f�i�l�e�O�p�e�r�a�t�o�r� �h�a�s� �a�l�r�e�a�d�y� �r�e�a�d� �t�h�e� �c�o�n�t�e�n�t� �i�t� �d�o�e�s� �n�o�t� �r�e�a�d� �a�g�a�i�n�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�f�i�l�e�O�p�e�r�a�t�o�r�.�&�#�3�6�;�w�r�i�t�e�(�w�a�i�t�)�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�u�l�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�w�a�i�t�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�D�a�t�a�_�s�t�r�u�c�t�u�r�e�s�#�b�o�o�l�e�a�n�_�t�y�p�e�"�>�&�l�t�;�b�o�o�l�e�a�n�&�g�t�;�<�/�a�>� �D�e�f�a�u�l�t�:� �<�c�o�d�e�>�f�a�l�s�e�<�/�c�o�d�e�>�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � �W�h�e�n� �w�a�i�t� �i�s� �<�c�o�d�e�>�t�r�u�e�<�/�c�o�d�e�>� �a�l�l� �p�r�o�p�e�r�t�i�e�s� �f�r�o�m� �f�i�l�e�O�p�e�r�a�t�o�r� �a�r�e� �s�t�r�i�n�g�i�f�i�e�d� �d�u�r�i�n�g� �i�t�'�s� �t�u�r�n� �i�n� �t�h�e� �c�a�l�l�b�a�c�k� �q�u�e�u�e�.� �W�h�e�n� �<�c�o�d�e�>�f�a�l�s�e�<�/�c�o�d�e�>� �i�t�'�s� �p�r�o�p�e�r�t�i�e�s� �a�r�e� �s�t�r�i�n�g�i�f�i�e�d� �i�m�m�e�d�i�a�t�e�l�y�
�
� � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � �<�/�u�l�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �W�r�i�t�i�n�g� �c�o�n�t�e�n�t� �t�o� �t�h�e� �f�i�l�e� �i�s� �a�n� �a�s�y�n�c�h�r�o�n�o�u�s� �o�p�e�r�a�t�i�o�n�.� �I�t� �m�u�s�t� �f�i�r�s�t� �s�t�r�i�n�g�i�f�y� �a�l�l� �p�r�o�p�e�r�t�i�e�s� �o�f� �f�i�l�e�O�p�e�r�a�t�o�r� �a�n�d� �t�h�e�n� �w�r�i�t�e�s� �t�h�a�t� �t�o� �t�e� �f�i�l�e�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�f�i�l�e�O�p�e�r�a�t�o�r�.�&�#�3�6�;�c�l�o�s�e�(�c�a�l�l�b�a�c�k�)�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�u�l�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�c�a�l�l�b�a�c�k�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�R�e�f�e�r�e�n�c�e�/�G�l�o�b�a�l�_�O�b�j�e�c�t�s�/�F�u�n�c�t�i�o�n�"�>�&�l�t�;�F�u�n�c�t�i�o�n�&�g�t�;�<�/�a�>�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�d�i�v�>�<�b�>�<�c�o�d�e�>�f�u�n�c�t�i�o�n� �c�a�l�l�b�a�c�k�(�f�i�l�e�p�a�t�h�)� �{�}�<�/�c�o�d�e�>�<�/�b�>�<�/�d�i�v�>�
�
� � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � �I�f� �t�h�e� �c�o�n�n�e�c�t�i�o�n�s� �c�o�u�n�t�e�r� �d�i�d� �n�o�t� �r�e�a�c�h� �<�c�o�d�e�>�0�<�/�c�o�d�e�>� �t�h�e� �p�a�r�a�m�e�t�e�r� �f�i�l�e�p�a�t�h� �i�s� �<�c�o�d�e�>�n�u�l�l�<�/�c�o�d�e�>�.� �H�o�w�e�v�e�r� �i�f� �t�h�e� �c�o�n�n�e�c�t�i�o�n�s� �d�i�d� �r�e�a�c�h� �<�c�o�d�e�>�0�<�/�c�o�d�e�>� �a�n�d� �a�f�t�e�r� �t�h�e� �f�i�l�e� �d�e�s�c�r�i�p�t�o�r� �h�a�s� �c�l�o�s�e�d� �t�h�e� �f�i�l�e�p�a�t�h� �i�s� �t�h�e� �f�i�l�e�p�a�t�h�.�
�
� � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � �<�/�u�l�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �C�l�o�s�i�n�g� �t�h�e� �l�a�s�t� �f�i�l�e�O�p�e�r�a�t�o�r� �d�e�c�r�e�m�e�n�t�s� �T�h�e� �c�o�n�n�e�c�t�i�o�n�s� �c�o�u�n�t�e�r�.� �W�h�e�n� �t�h�e� �c�o�n�n�e�c�t�i�o�n�s� �c�o�u�n�t�e�r� �r�e�a�c�h�e�s� �0� �a�n� �a�s�y�n�c�h�r�o�n�o�u�s� �o�p�e�r�a�t�i�o�n� �t�h�a�t� �c�l�o�s�e�s� �t�h�e� �f�i�l�e� �d�e�s�c�r�i�p�t�o�r�.� �W�h�e�n� �t�h�e� �l�a�s�t� �f�i�l�e�O�p�e�r�a�t�o�r� �h�a�s� �c�l�o�s�e�d� �m�a�k�e� �s�u�r�e� �a�l�l� �r�e�f�r�e�n�c�e�s� �t�o� �t�h�e� �i�n�s�t�a�n�c�e� �a�r�e� �r�e�m�o�v�e�d� �s�o� �i�t� �c�a�n� �b�e� �g�a�r�b�a�g�e� �c�o�l�l�e�c�t�e�d�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�f�i�l�e�O�p�e�r�a�t�o�r�.�&�#�3�6�;�o�n�R�e�a�d�y�(�c�a�l�l�b�a�c�k�[�,� �.�.�.�a�r�g�s�]�)�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�u�l�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�c�a�l�l�b�a�c�k�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�R�e�f�e�r�e�n�c�e�/�G�l�o�b�a�l�_�O�b�j�e�c�t�s�/�F�u�n�c�t�i�o�n�"�>�&�l�t�;�F�u�n�c�t�i�o�n�&�g�t�;�<�/�a�>�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�b�>�<�c�o�d�e�>�f�u�n�c�t�i�o�n� �c�a�l�l�b�a�c�k�(�f�i�l�e�O�p�e�r�a�t�o�r�[�,� �.�.�.�a�r�g�s�]�)� �{�}�<�/�c�o�d�e�>�<�/�b�>�
�
� � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � �T�h�e� �f�i�r�s�t� �a�r�g�u�m�e�n�t� �o�f� �t�h�e� �c�a�l�l�b�a�c�k� �t�h�e� �f�i�l�e�O�p�e�r�a�t�o�r�.� �W�h�e�n� �a�r�g�u�m�e�n�t�s� �w�e�r�e� �p�a�s�s�e�d� �i�n�t�o� �o�n�R�e�a�d�y� �t�h�e�y� �c�a�n� �b�e� �c�a�p�t�u�r�e�d� �i�n� �a�r�g�s�.�
�
� � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�a�r�g�s�<�/�c�o�d�e�>� �o�p�t�i�o�n�a�l�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � �T�h�e� �a�r�g�u�m�e�n�t�s� �a�r�e� �p�a�s�s�e�d� �o�v�e�r� �t�o� �t�h�e� �c�a�l�l�b�a�c�k�.�
�
� � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � �<�/�u�l�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �A�l�l�o�w�s� �s�y�n�c�h�r�o�n�o�u�s�l�y� �i�n�v�o�k�i�n�g� �a� �c�a�l�l�b�a�c�k� �u�n�t�i�l�l� �a�l�l� �p�r�e�v�i�o�u�s� �a�s�y�n�c�h�r�o�n�o�u�s� �o�p�e�r�a�t�i�o�n�s� �h�a�v�e� �f�i�n�i�s�h�e�d�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�f�i�l�e�O�p�e�r�a�t�o�r�.�&�#�3�6�;�p�a�r�s�e�(�d�a�t�a�)�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�u�l�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�d�a�t�a�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�D�a�t�a�_�s�t�r�u�c�t�u�r�e�s�#�S�t�r�i�n�g�_�t�y�p�e�"�>�&�l�t�;�s�t�r�i�n�g�&�g�t�;�<�/�a�>�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � �T�h�i�s� �d�a�t�a� �p�a�r�a�m�e�t�e�r� �i�s� �t�h�e� �r�e�a�d� �c�o�n�t�e�n�t� �f�r�o�m� �t�h�e� �f�i�l�e� �a�f�t�e�r� �h�a�v�i�n�g� �r�e�a�d� �t�h�e� �c�o�n�t�e�n�t� �f�r�o�m� �t�h�e� �f�i�l�e�.�
�
� � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � �<�/�u�l�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �T�h�e� �d�e�f�a�u�l�t� �p�a�r�s�e�r� �f�r�o�m� �t�h�i�s� �m�e�t�h�o�d� �i�s� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�R�e�f�e�r�e�n�c�e�/�G�l�o�b�a�l�_�O�b�j�e�c�t�s�/�J�S�O�N�/�p�a�r�s�e�"�>�&�#�7�4�;�&�#�8�3�;�&�#�7�9�;�&�#�7�8�;�.�p�a�r�s�e�(�)�<�/�a�>�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�f�i�l�e�O�p�e�r�a�t�o�r�.�&�#�3�6�;�s�t�r�i�n�g�i�f�y�(�d�a�t�a�)�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�u�l�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�d�a�t�a�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�R�e�f�e�r�e�n�c�e�/�G�l�o�b�a�l�_�O�b�j�e�c�t�s�/�O�b�j�e�c�t�"�>�&�l�t�;�o�b�j�e�c�t�&�g�t�;�<�/�a�>�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � �T�h�e� �d�a�t�a� �p�a�r�a�m�e�t�e�r� �i�s� �t�h�e� �f�i�l�e�O�p�e�r�a�t�o�r�.�
�
� � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � �<�/�u�l�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �T�h�e� �d�e�f�a�u�l�t� �s�t�r�i�n�g�i�f�i�e�r� �f�r�o�m� �t�h�i�s� �m�e�t�h�o�d� �i�s� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�R�e�f�e�r�e�n�c�e�/�G�l�o�b�a�l�_�O�b�j�e�c�t�s�/�J�S�O�N�/�s�t�r�i�n�g�i�f�y�"�>�&�#�7�4�;�&�#�8�3�;�&�#�7�9�;�&�#�7�8�;�.�s�t�r�i�n�g�i�f�y�(�)�<�/�a�>�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�f�i�l�e�O�p�e�r�a�t�o�r�.�f�i�l�e�p�a�t�h�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �R�e�a�d�a�b�l�e� �p�r�o�p�e�r�t�y� �t�h�a�t� �r�e�t�u�r�n� �t�h�e� �f�i�l�e�p�a�t�h� �o�f� �a� �f�i�l�e�O�p�e�r�a�t�o�r�s�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�f�i�l�e�O�p�e�r�a�t�o�r�.�c�o�n�n�e�c�t�i�o�n�s�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �R�e�a�d�a�b�l�e� �p�r�o�p�e�r�t�y� �t�h�a�t� �r�e�t�u�r�n� �t�h�e� �c�o�n�n�e�c�t�i�o�n� �c�o�u�n�t�e�r� �o�f� �a� �f�i�l�e�O�p�e�r�a�t�o�r�s�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�F�i�l�e�O�p�e�r�a�t�o�r�.�s�a�v�e�A�n�d�E�x�i�t�A�l�l�(�o�p�t�i�o�n�s�)�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�u�l�>�
�
� � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � �<�c�o�d�e�>�o�p�t�i�o�n�s�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�R�e�f�e�r�e�n�c�e�/�G�l�o�b�a�l�_�O�b�j�e�c�t�s�/�O�b�j�e�c�t�"�>�&�l�t�;�o�b�j�e�c�t�&�g�t�;�<�/�a�>�
�
� � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � �<�u�l�>�
�
� � � � � � � � � � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � � � � � � � � � �<�c�o�d�e�>�l�o�g�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�D�a�t�a�_�s�t�r�u�c�t�u�r�e�s�#�S�t�r�i�n�g�_�t�y�p�e�"�>�&�l�t�;�s�t�r�i�n�g�&�g�t�;�<�/�a�>� �D�e�f�a�u�l�t�:� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�A�P�I�/�C�o�n�s�o�l�e�/�l�o�g�"�>�c�o�n�s�o�l�e�.�l�o�g�<�/�a�>�
�
� � � � � � � � � � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � � � � � � � � � �W�h�e�n� �a� �f�i�l�e�O�p�e�r�a�t�o�r� �i�s� �c�l�o�s�e�d� �t�h�e� �m�e�s�s�a�g�e� �<�c�o�d�e�>�"�s�a�v�e�d� �&�#�3�6�;�{�f�i�l�e�O�p�e�r�a�t�o�r�.�f�i�l�e�p�a�t�h�}�"�<�/�c�o�d�e�>� �i�s� �p�a�s�s�e�d� �t�h�r�o�u�g�h� �t�h�e� �l�o�g� �f�u�n�c�t�i�o�n�.�
�
� � � � � � � � � � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � � � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � � � � � �<�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � � � � � � � � � �<�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � � � � � � � � � �<�c�o�d�e�>�c�a�l�l�b�a�c�k�<�/�c�o�d�e�>� �<�a� �h�r�e�f�=�"�h�t�t�p�s�:�/�/�d�e�v�e�l�o�p�e�r�.�m�o�z�i�l�l�a�.�o�r�g�/�e�n�-�U�S�/�d�o�c�s�/�W�e�b�/�J�a�v�a�S�c�r�i�p�t�/�R�e�f�e�r�e�n�c�e�/�G�l�o�b�a�l�_�O�b�j�e�c�t�s�/�F�u�n�c�t�i�o�n�"�>�&�l�t�;�F�u�n�c�t�i�o�n�&�g�t�;�<�/�a�>�
�
� � � � � � � � � � � � � � � � � � � � �<�/�s�u�m�m�a�r�y�>�
�
� � � � � � � � � � � � � � � � � � � � �<�d�i�v�>�
�
� � � � � � � � � � � � � � � � � � � � � � � � �W�h�e�n� �a�l�l� �f�i�l�e�O�p�e�r�a�t�o�r�s� �h�a�v�e� �c�l�o�s�e�d� �t�h�i�s� �f�u�n�c�t�i�o�n� �i�s� �i�n�v�o�k�e�d�.�
�
� � � � � � � � � � � � � � � � � � � � �<�/�d�i�v�>�
�
� � � � � � � � � � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � � � � � � � � � �<�/�u�l�>�
�
� � � � � � � � �<�/�d�e�t�a�i�l�s�>�
�
� � � � �<�/�u�l�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �T�h�i�s� �s�t�a�t�i�c� �m�e�t�h�o�d� �t�h�a�t� �s�a�v�e�s� �a�n�d� �c�l�o�s�e�s� �a�l�l� �f�i�l�e�O�p�e�r�a�t�o�r�s� �a�n�d� �d�e�s�t�r�o�y�s� �t�h�e�m�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�3�>�<�c�o�d�e�>�F�i�l�e�O�p�e�r�a�t�o�r�.�l�i�s�t�<�/�c�o�d�e�>�<�/�h�3�>�
�
� � � � �<�d�i�v�>�
�
� � � � � � � � �R�e�a�d�a�b�l�e� �p�r�o�p�e�r�t�y� �t�h�a�t� �r�e�t�u�r�n� �a�n� �a�r�r�a�y� �o�f� �a�l�l� �f�i�l�e�O�p�e�r�a�t�o�r�s�.�
�
� � � � �<�/�d�i�v�>�
�
�<�/�d�i�v�>�
�
�
�
�<�d�i�v�>�
�
� � � � �<�h�2�>�E�x�a�m�p�l�e�<�/�h�2�>�
�
�<�/�d�i�v�>�
�
�
�
��
��j�a�v�a�s�c�r�i�p�t�
�
�/�/� �c�o�n�s�t� �Y�A�M�L� �=� �r�e�q�u�i�r�e�(�"�y�a�m�l�j�s�"�)�;�
�
�c�l�a�s�s� �M�o�n�k�e�y�J�S�O�N� �e�x�t�e�n�d�s� �F�i�l�e�O�p�e�r�a�t�o�r� �{�
�
� �c�o�n�s�t�r�u�c�t�o�r�(�)� �{�
�
� � �s�u�p�e�r�(�"�m�o�n�k�e�y�.�j�s�o�n�"�)�;�
�
� �}�;�
�
� �$�t�e�s�t�(�)� �{�
�
� � �t�h�i�s�.�s�a�y�s� �=� �"�h�o�e�h�o�e�h�a�h�a�"�;�
�
� � �t�h�i�s�[�"�l�o�o�k�s� �l�i�k�e�"�]� �=� �"�=�5�"�;�
�
� � �t�h�i�s�.�i�s� �=� �"�a� �m�o�n�k�e�y�"�;�
�
� � �t�h�i�s�.�l�i�v�e�s� �=� �"�i�n� �a� �t�r�e�e�"�;�
�
� � �r�e�t�u�r�n� �t�h�i�s�;�
�
� �}�;�
�
� �$�c�o�u�n�t�(�)� �{�
�
� � �t�h�i�s�.�c�o�u�n�t�e�r� �?� �t�h�i�s�.�c�o�u�n�t�e�r�+�+� �:� �t�h�i�s�.�c�o�u�n�t�e�r� �=� �1�;�
�
� � �r�e�t�u�r�n� �t�h�i�s�;�
�
� �}�;�
�
� �/�*� �o�p�t�i�o�n�a�l�
�
� �$�p�a�r�s�e�(�d�a�t�a�)� �{�
�
� � �r�e�t�u�r�n� �Y�A�M�L�.�p�a�r�s�e�(�d�a�t�a�)�;�
�
� �}�;�
�
� �$�s�t�r�i�n�g�i�f�y�(�d�a�t�a�)� �{�
�
� � �r�e�t�u�r�n� �Y�A�M�L�.�s�t�r�i�n�g�i�f�y�(�d�a�t�a�)�;�
�
� �}�;�
�
� �/�/�*�/�
�
�}�;�
�
�n�e�w� �M�o�n�k�e�y�J�S�O�N�(�)�.�$�r�e�a�d�(�)�.�$�t�e�s�t�(�)�.�$�o�n�R�e�a�d�y�(�m�o�n�k�e�y� �=�>� �m�o�n�k�e�y�.�$�c�o�u�n�t�(�)�)�.�$�w�r�i�t�e�(�t�r�u�e�)�.�$�c�l�o�s�e�(�(�)� �=�>� �{�
�
� �c�o�n�s�o�l�e�.�l�o�g�(�"�c�l�o�s�e�d� �m�o�n�k�e�y�.�j�s�o�n�"�)�;�
�
�}�)�;�
�
�/�/�
�
�/�/�
�
�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�
�
�/�/�
�
�/�/� �A�n� �e�x�a�m�p�l�e� �f�r�o�m� �h�t�t�p�s�:�/�/�g�i�t�h�u�b�.�c�o�m�/�B�e�r�e�n�d�K�e�m�p�e�r�/�a�p�p�
�
�/�/�
�
�n�e�w� �F�i�l�e�O�p�e�r�a�t�o�r�(�"�.�/�a�p�i�s�.�j�s�o�n�"�)�.�$�r�e�a�d�(�t�r�u�e�)�.�$�o�n�R�e�a�d�y�(�a�p�i�s� �=�>� �{�
�
� �a�p�p�.�l�o�a�d�A�p�i�R�e�g�i�s�t�e�r�(�a�p�i�s�)�;�
�
� �c�o�n�s�o�l�e�.�l�o�g�(�"�R�e�g�i�s�t�e�r�e�d� �A�p�i� �e�n�d�p�o�i�n�t�s�:�"�,� �a�p�p�.�a�p�i�s�)�;�
�
� �a�p�p�.�l�i�s�t�e�n�(�)�;�
�
�}�)�;�
�
�/�/� �.�.�.�
�
�p�r�o�c�e�s�s�.�o�n�(�"�S�I�G�I�N�T�"�,� �(�)� �=�>� �{�
�
� �l�o�g�g�e�r�.�e�r�r�o�r�(�"�N�o�d�e� �J�S� �i�s� �n�o�w� �s�h�u�t�t�i�n�g� �d�o�w�n� �d�u�e� �t�o� �p�r�e�s�s�i�n�g� �c�t�r�l� �+� �c�"�)�;� �/�/� �f�i�l�e�s�t�r�e�a�m�-�l�o�g�g�e�r�
�
� �F�i�l�e�O�p�e�r�a�t�o�r�.�s�a�v�e�A�n�d�E�x�i�t�A�l�l�(�{�
�
� � �l�o�g�:� �l�o�g�g�e�r�.�l�o�g�,� �/�/� �f�i�l�e�s�t�r�e�a�m�-�l�o�g�g�e�r�
�
� � �c�a�l�l�b�a�c�k�(�)� �{�
�
� � � �F�i�l�e�s�t�r�e�a�m�L�o�g�g�e�r�.�d�e�s�t�r�o�y�A�l�l�(�(�)� �=�>� �p�r�o�c�e�s�s�.�e�x�i�t�(�)�)�;�
�
� � �}�
�
� �}�)�;�
�
�}�)�;�
�
�
��
�