Package net.jxta.share

Examples of net.jxta.share.ContentManager


            File temp = new File(myPath.getAbsolutePath() + File.separator + "shares.ser");
            if(temp.exists()){
                temp.delete();
            }
            //sharing all files in shared directory
            ContentManager contentManager = null;
            contentManager = cms.getContentManager();
            File[] list = myPath.listFiles();
            Arrays.sort(
                    list,
                    new Comparator<File>() {
                        @Override
                        public int compare(File a, File b) {
                            return a.getName().compareTo(b.getName());
                        }
                    });
            CheckSumCalc checkSum = new CheckSumCalc();


            for (int i = 0; i < list.length; i++) {
                if (list[i].isFile()) {//Sharing Files and check sums in network
                    contentManager.share(list[i], checkSum.getFileSum(list[i]));
                }
            }
            printOnLog("======= Conteúdo compartilhado =======\n");
            //viewing the shared contents
            Content[] content = cms.getContentManager().getContent();
View Full Code Here

TOP

Related Classes of net.jxta.share.ContentManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.