/// <summary> /// Write package meta/xml data file(either if it not exist, you can use a get meta before to generate it, this is the way used to create a new package). /// </summary> /// <param name="PkgName"> /// Package name to create or edit. /// </param> /// <param name="XmlFs"> /// The file path and name who contain the XML meta data. /// </param> /// <returns> /// A <see cref="StringBuilder"/>The status of the operation in XML format. /// </returns> /// <example> This sample shows how to call the PutProjectPkgMeta method. /// <code> /// using System; /// using MonoOBSFramework.Functions.Sources /// class TestClass /// { /// static int Main() /// { /// if(!VarGlobal.LessVerbose)Console.WriteLine(PutProjectPkgMeta.PutSourceProjectPkgMeta("MonoOSC","home/user/tmp/TmpMeta.xml").ToString()); /// } /// } /// </code> /// </example> public static StringBuilder PutProjectPkgMeta(string PkgName, string XmlFs) { if (Environment.OSVersion.Platform == PlatformID.Unix) { return(PUT.UploadFileCore("source/" + VarGlobal.PrefixUserName + "/" + PkgName + "/_meta", VarGlobal.User, VarGlobal.Password, XmlFs)); } else { return(PUT.Putit("source/" + VarGlobal.PrefixUserName + "/" + PkgName + "/_meta", VarGlobal.User, VarGlobal.Password, XmlFs)); } }
/// <summary> /// Write user data. /// </summary> /// <param name="XmlFs">The file path and name who contain the XML meta data, use get person to have an existing one or a new.</param> /// <returns> /// A <see cref="StringBuilder"/>The status of the operation in XML format. /// </returns> /// <example> This sample shows how to call the PutPersonData method. /// <code> /// using System; /// using MonoOBSFramework.Functions.User.Data /// class TestClass /// { /// static int Main() /// { /// if(!VarGlobal.LessVerbose)Console.WriteLine(PutPerson.PutPersonData("home/user/tmp/TmpMeta.xml").ToString()); /// } /// } /// </code> /// </example> public static StringBuilder PutPersonData(string XmlFs) { //return PUT.Putit("person/" + UserName + "?" + ArgName + "=" + ArgValue, VarGlobal.User, VarGlobal.Password); if (Environment.OSVersion.Platform == PlatformID.Unix) { return(PUT.UploadFileCore("person/", VarGlobal.User, VarGlobal.Password, XmlFs)); } else { return(PUT.Putit("person/", VarGlobal.User, VarGlobal.Password, XmlFs)); } }
/// <summary> /// /// </summary> /// <param name="PrjName"> /// A <see cref="System.String"/> /// </param> /// <param name="PkgName"> /// A <see cref="System.String"/> /// </param> /// <param name="FileName"> /// A <see cref="System.String"/> /// </param> /// <returns> /// A <see cref="StringBuilder"/> /// </returns> public static StringBuilder PutFile(string PrjName, string PkgName, string FileName) { System.IO.FileInfo FsInf = new System.IO.FileInfo(FileName); StringBuilder Result = null; if (Environment.OSVersion.Platform == PlatformID.Unix) { Result = PUT.UploadFileCore("source/" + PrjName + "/" + PkgName + "/" + FsInf.Name + "?rev=upload", VarGlobal.User, VarGlobal.Password, FileName); } else { //FIXME : Putit replaced by UploadFileCore Result = PUT.UploadFileCore("source/" + PrjName + "/" + PkgName + "/" + FsInf.Name + "?rev=upload", VarGlobal.User, VarGlobal.Password, FileName); } Commit.PostCommit(PkgName); return(Result); }