/*
 * Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved.
 *
 * This file is part of Aspose.Slides. The source code in this file
 * is only intended as a supplement to the documentation, and is provided
 * "as is", without warranty of any kind, either expressed or implied.
 */
package com.aspose.tasks.examples.Projects;


import com.aspose.tasks.*;
import com.aspose.tasks.Project;
import com.aspose.tasks.examples.Utils;

import java.io.FileInputStream;

public class ReadProjectFiles
{
    public static void main(String[] args) throws Exception
    {
    	// The path to the documents directory.
        String dataDir = Utils.getDataDir(ReadProjectFiles.class);
        
        ReadProjectAsTemplate(dataDir);
        ReadProjectFileFromStream(dataDir);
    }
    
    public static void ReadProjectAsTemplate(String dataDir)
    {
    	// ExStart: ReadProjectAsTemplate
    	// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
    	// Read existing project template file
    	Project project = new Project(dataDir + "ReadProjectFiles.mpt");
    	System.out.println("Name : " + project.get(Prj.NAME));
    	// ExEnd: ReadProjectAsTemplate
    }
    
    public static void ReadProjectFileFromStream(String dataDir)
    {
    	// ExStart: ReadProjectFiles
    	// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
        try
        {
        	FileInputStream prjStream = new FileInputStream(dataDir + "Project1.mpp");
        	Project existingProject = new Project(prjStream);
        	prjStream.close();
        	
        	System.out.println("Calendar : " + existingProject.get(Prj.NAME));
        }
        catch(Exception ex)
        {
        	System.out.println(ex.getMessage());
        }
        // ExEnd: ReadProjectFiles
        // Display result of conversion.
        System.out.println("Process completed Successfully");
    }
}





@@ -671,24 +671,76 @@
 );%0A        %0A
+        CheckIfProjectIsPasswordProtected(dataDir);%0A
         Read
@@ -814,32 +814,382 @@
 ir);%0A    %7D%0A    %0A
+    public static void CheckIfProjectIsPasswordProtected(String dataDir)%0A    %7B%0A    %09//ExStart: CheckIfProjectIsPasswordProtected%0A    %09ProjectFileInfo info = Project.getProjectFileInfo(dataDir + %22project.mpp%22);%0A    %09System.out.println(%22Is file password protected?:%22 + info.isPasswordProtected());%0A    %09//ExEnd: CheckIfProjectIsPasswordProtected%0A    %7D%0A
     public stati

Update ReadProjectFiles.java