Esempio n. 1
0
        public bool RemoveOldFile(string fileName)
        {
            //Boolean for whether the old file was removed
            bool success;

            //Tries to remove the file
            try
            {
                //Tries to remove the file
                response = uploadService.RemoveFileByName(fileName);

                //Stores whether the file was removed or not
                success = response.IsResponseSuccess();
            }
            //If there are any exceptions
            catch (Exception ex)
            {
                //If the exception message contains the text in the brackets
                if (ex.Message.Contains("The file with the name '" + fileName + "' does not exist."))
                {
                    //Set the file to removed because it never existed in the first place
                    success = true;
                }
                //If the exception message was anything else
                else
                {
                    //Sets the file to not removed
                    success = false;
                }
            }

            //Returns whether the file was removed
            return(success);
        }
Esempio n. 2
0
        public void OnSuccess(object response)
        {
            App42Response app42response = (App42Response)response;

            Debug.Log("App42Response is : " + app42response);

            bool success = app42response.IsResponseSuccess();

            Debug.Log(success);
        }