Package org.marian.core.exceptions

Examples of org.marian.core.exceptions.ShareException


        if (f.isDirectory())
            e.setAttribute(SharesXML.ATTR_TYPE, ShareType.Folder.name());
        else if (f.isFile())
            e.setAttribute(SharesXML.ATTR_TYPE, ShareType.File.name());
        else
            throw new ShareException("Unknown file type for location '"+location+"'");
        this.root.appendChild(e);
        this.save();
    }
View Full Code Here


    /** Add a conctat to a shared item */
    public void addContact(String share, String contact) throws  ShareException, Exception
    {
        Element s = this.getShareElement(share);
        if (s == null)
            throw new ShareException("Share not found: "+share);
        Element c = this.document.createElement(SharesXML.TAG_CONTACT);
        if (c == null)
            throw new ShareException("Contact not found: "+contact);
        c.setAttribute(SharesXML.ATTR_NAME, contact);
        s.appendChild(c);
        this.save();
    }
View Full Code Here

        NodeList nl;
        try {
          nl = this.xSearch(expr);
        } catch (XPathExpressionException ex)
        {
          throw new ShareException("XPathExpressionException: "+ex.toString());
        }
        for (int i = 0; i < nl.getLength (); i++)       
          this.document.removeChild((Element) nl.item(i));
        this.save();
    }
View Full Code Here

    public ShareType getType(String share_name) throws ShareException, XPathExpressionException
    {
        Element e = this.getShareElement(share_name);
        if (e == null)
            throw new ShareException("Cannot find share: "+share_name);
        return ShareType.valueOf(e.getAttribute(SharesXML.ATTR_TYPE));
    }
View Full Code Here

TOP

Related Classes of org.marian.core.exceptions.ShareException

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.