2 Examples to Show How Java Exception Handling Works

There are 2 examples below. One shows all caller methods also need to handle exceptions thrown by the callee method. The other one shows the super class can be used to catch or handle subclass exceptions. Caller method must handle exceptions thrown by the callee method Here is a program which handles exceptions. Just test … Read more

Requirement Analysis for Centralized File Management System

The following is the requirement summary for building a new centralized file management system (FMS): 1. After merging the central FMS, each individual system will use web service to connect to it. And all files and related information will be put in a central place. 2. The central should have the following functions: Authenticate Upload … Read more

Using Alfresco PHP Web Service to upload files

The following is the PHP code for uploading files using Alfresco Web Service. I put some comments inside the code. If there is anything confuses you, please leave your comment and I hope I can help. if (isset($_SERVER["ALF_AVAILABLE"]) == false) { require_once "./alfresco_sdk/remote/Alfresco/Service/Repository.php"; require_once "./alfresco_sdk/remote/Alfresco/Service/Session.php"; require_once "./alfresco_sdk/remote/Alfresco/Service/SpacesStore.php"; require_once "./alfresco_sdk/remote/Alfresco/Service/ContentData.php"; } $repositoryUrl = "http://localhost:8080/alfresco/api"; $userName = … Read more

Declaration, Initialization and Scoping for Java

The following is a summary for showing Java declaration, initialization and scoping. Variables defined in try block are not visible in catch block. You cannot pass parameters when you implement an interface by an anonymous class. Constructors cannot return anything. Not even void. Every enum has a values() method that returns an array of all … Read more