package com.aspose.slides.examples.Presentation.Properties;

import com.aspose.slides.IDocumentProperties;
import com.aspose.slides.Presentation;
import com.aspose.slides.SaveFormat;
import com.aspose.slides.examples.Utils;

public class AccessingAndModifyingCustomProperties {

	public static void main(String[] args) {
		
		// The path to the documents directory.
        String dataDir = Utils.getDataDir(AccessingAndModifyingCustomProperties.class);
        
		Presentation pres = new Presentation(dataDir + "Presentation.pptx");

		// Create a reference to DocumentProperties object associated with
		// Presentation
		IDocumentProperties dp = pres.getDocumentProperties();

		// Access and modify custom properties
		for (int i = 0; i < dp.getCount(); i++) {
			// Display names and values of custom properties
			System.out.println("Custom Property Name : " + dp.getPropertyName(i));
			System.out.println("Custom Property Value : " + dp.get_Item(dp.getPropertyName(i)));

			// Modify values of custom properties
			dp.set_Item(dp.getPropertyName(i), "New Value " + (i + 1));
		}

		// Save your presentation to a file
		pres.save(dataDir + "CustomDemoModified.pptx", SaveFormat.Pptx);

	}

}

package com.aspose.slides.examples.Presentation.Properties;

import com.aspose.slides.IDocumentProperties;
import com.aspose.slides.Presentation;
import com.aspose.slides.SaveFormat;
import com.aspose.slides.examples.Utils;

public class AccessingAndModifyingCustomProperties {

	public static void main(String[] args) {
		
		// The path to the documents directory.
        	String dataDir = Utils.getDataDir(AccessingAndModifyingCustomProperties.class);
        
		Presentation pres = new Presentation(dataDir + "Presentation.pptx");

		// Create a reference to DocumentProperties object associated with Presentation
		IDocumentProperties dp = pres.getDocumentProperties();

		// Access and modify custom properties
		for (int i = 0; i < dp.getCount(); i++) {
			// Display names and values of custom properties
			System.out.println("Custom Property Name : " + dp.getPropertyName(i));
			System.out.println("Custom Property Value : " + dp.get_Item(dp.getPropertyName(i)));

			// Modify values of custom properties
			dp.set_Item(dp.getPropertyName(i), "New Value " + (i + 1));
		}

		// Save your presentation to a file
		pres.save(dataDir + "CustomDemoModified.pptx", SaveFormat.Pptx);

	}

}

Update AccessingAndModifyingCustomProperties.java